When IOS refreshes the row of a row in TableView, the row height increases and the data increases.

Source: Internet
Author: User

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.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.