Home Increase the label height and cell height based on the content getting in service in UITableviewCell using Xib Objective-C
Reply: 0

Increase the label height and cell height based on the content getting in service in UITableviewCell using Xib Objective-C

user714
1#
user714 Published in August 16, 2018, 6:16 am

Came across a problem with UITableViewCell. Am using Xib. I have 4 labels one below the other in UITableViewCell, lbl1,lbl2,lbl3,lbl4. lbl2 and lbl3 are dynamic text, Here how to increase lbl2,lbl3 height based on the text coming from service and increase cell height based on the content in the cell. Tried the following code. But doesn't help. Am using AutoLayouts here.TIA

- (void)viewDidLoad {
    [super viewDidLoad];
    _tblView.rowHeight = UITableViewAutomaticDimension;
    _tblView.estimatedRowHeight = 140;

}

// cellForRowAtIndexPath

    cell.lbl2.numberOfLines = 0;

    [cell.lbl2 sizeToFit];

    cell.lbl3.numberOfLines = 0;

    [cell.lbl3 sizeToFit];
You need to login account before you can post.

About| Privacy statement| Terms of Service| Advertising| Contact us| Help| Sitemap|
Processed in 0.288736 second(s) , Gzip On .

© 2016 Powered by mzan.com design MATCHINFO