Note that there are some explanatory texts on larger screens.

plurals
  1. POUILabel doesn't change height in UITableViewCell in first scroll
    primarykey
    data
    text
    <p>I'm using tableview on storyboard. </p> <p>I change label's frame in <code>(UITableViewCell*)tableView:(UITableView*)tableView cellForRowAtIndexPath:(NSIndexPath*)indexPath</code> function. </p> <p>then, after some scrolling, it can change frame. but, when I open my application, frame doesn't change at first.</p> <p>sorry, can't post image till 10 reputation. please help. </p> <pre><code>- (UITableViewCell*)tableView:(UITableView*)tableView cellForRowAtIndexPath:(NSIndexPath*)indexPath { // get one row Plan* planObj = [_planObjList objectAtIndex:indexPath.row]; // get custom cell info LargeImageCell* cell = (LargeImageCell*)[tableView dequeueReusableCellWithIdentifier:@"CustomLargeImageCell"]; cell.backgroundColor = [UIColor colorWithPatternImage:[UIImage imageNamed:@"bg"]]; cell.selectionStyle = UITableViewCellSelectionStyleNone; cell.titleLabel.text = planObj.planTitle; cell.titleLabel.numberOfLines = 0; cell.titleLabel.lineBreakMode = NSLineBreakByWordWrapping; cell.userNameLabel.text = planObj.getProducerName; // title size CGSize titleSize = [cell.titleLabel.text boundingRectWithSize:CGSizeMake(300.0f, CGFLOAT_MAX) options:(NSStringDrawingUsesLineFragmentOrigin) attributes:@{NSFontAttributeName: cell.titleLabel.font} context:nil].size; // user name size CGSize userNameSize = [cell.userNameLabel.text boundingRectWithSize:CGSizeMake(300.0f, CGFLOAT_MAX) options:(NSStringDrawingUsesLineFragmentOrigin) attributes:@{NSFontAttributeName: cell.userNameLabel.font} context:nil].size; // set title size cell.titleLabel.frame = CGRectMake(7.0f, 230.0f, 306.0f, ceilf(5.0f + titleSize.height)); cell.titleLabel.backgroundColor = [UIColor redColor]; // set name size cell.userNameLabel.frame = CGRectMake(7.0f, ceilf(235.0f + titleSize.height), 148.0f, ceilf(5.0f + userNameSize.height)); cell.userNameLabel.backgroundColor = [UIColor blueColor]; } </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload