Nsmutablearray *array=[nsmutablearray arraywithobjects:@ "444", @ "555", @ "666", @ "777", @ "888", nil];
if (array.count==0) {
UILabel *detaillabel=[qssmycontrol Creatlabelwithframe:cgrectmake (Space1, label.frame.origin.y+ label.frame.size.height+10, width, height) text:@ "no record" Font:[uifont Systemfontofsize:14] Backgroundcolor:[uicolor Clearcolor] Textcolor:[uicolor Blackcolor];
[Cell.contentview Addsubview:detaillabel];
}else {
if (Array.count>3&&_ischoosemore==no) {
for (int i=0; i<3; i++) {
int x=i%3;
int Y=I/3;
UILabel *detaillabel=[qssmycontrol Creatlabelwithframe:cgrectmake (space1+width*x+space2*x, label.frame.origin.y+ label.frame.size.height+10, width, height) text:[nsstring stringwithformat:@ "Mr. * * * * Bid:%@", Array[i]] Font:[uifont SYSTEMFONTOFSIZE:14] Backgroundcolor:[uicolor Clearcolor] Textcolor:[uicolor Blackcolor];
NSLog (@ "x-----frame*************:%f", detaillabel.frame.origin.x);
NSLog (@ "y-----frame*************:%f", DETAILLABEL.FRAME.ORIGIN.Y);
[Cell.contentview Addsubview:detaillabel];
}
}else{
for (int i=0; i<array.count; i++) {
int x=i%3;
int Y=I/3;
UILabel *detaillabel=[qssmycontrol Creatlabelwithframe:cgrectmake (space1+width*x+space2*x, label.frame.origin.y+ Label.frame.size.height+10*y+height*y, width, height) text:[nsstring stringwithformat:@ "Mr. * * * * Bid:%@", Array[i]] Font:[uifont systemfontofsize:14] Backgroundcolor:[uicolor Clearcolor] Textcolor:[uicolor BlackColor]];
NSLog (@ "x-----frame*************:%f", detaillabel.frame.origin.x);
NSLog (@ "y-----frame*************:%f", DETAILLABEL.FRAME.ORIGIN.Y);
[Cell.contentview Addsubview:detaillabel];
}
}
}
Click event for button
-(void) Chujiagengduobutton: (UIButton *) button{
if (_ischoosemore==no) {
_ischoosemore=yes;
Nsindexpath *indexpath=[nsindexpath Indexpathforrow:2 insection:0];
[Self.mytableview Reloadrowsatindexpaths:[nsarray Arraywithobject:indexpath] Withrowanimation: Uitableviewrowanimationnone];
}else {
_ischoosemore=no;
Nsindexpath *indexpath=[nsindexpath Indexpathforrow:2 insection:0];
[Self.mytableview Reloadrowsatindexpaths:[nsarray Arraywithobject:indexpath] Withrowanimation: Uitableviewrowanimationnone];
}
}
When IOS refreshes the row of a row in TableView, the row height increases and the data increases.