vendredi 31 juillet 2015

UITextView height based on content text in UiTableView Cell

I try several time to make textview inside tableview cell to be sized height based on text inside textview. I tried the following with no luck:

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
    TnCityFeedCell *cell = [tableView dequeueReusableCellWithIdentifier:@"CityFeedCell" forIndexPath:indexPath];

    cell.FeedMainText.text = [[self.FeedArray valueForKey:@"FEED_MAIN_TEXT"] objectAtIndex:indexPath.row];


    CGSize size = [cell.FeedMainText systemLayoutSizeFittingSize:cell.FeedMainText.contentSize];
    CGRect frame = cell.FeedMainText.frame;
    frame.size.height = size.height;
    cell.FeedMainText.frame = frame;

    return cell;
}

I hope to find some way to solve this

Thanks :)

Aucun commentaire:

Enregistrer un commentaire