J'ai un UITableViewCell
personnalisé avec une vue de texte.Impossible d'augmenter UITableViewCell hight selon textView dynamiquement
La hauteur de textView augmente en fonction de son texte.
Je n'arrive pas à comprendre comment augmenter la hauteur de la cellule pour l'adapter à la vue du texte.
Voici mon code:
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
NotificationCell *cell = (NotificationCell *)[tableView dequeueReusableCellWithIdentifier:@"cell"];
if (cell == nil) {
NSArray *ary = [[NSBundle mainBundle]loadNibNamed:@"NotificationCell" owner:self options:nil];
cell = [ary objectAtIndex:0];
}
NSMutableDictionary *dict = [[NSMutableDictionary alloc] initWithDictionary:[NotificationArray objectAtIndex:indexPath.section]];
cell.title_lbl.text=[dict objectForKey:@"event_title"];
cell.description_lbl.text=[dict objectForKey:@"description"];
[cell.description_lbl sizeToFit];
[cell sizeToFit];
return cell;
}
Copie possible de [Augmenter la hauteur de la cellule tableview en fonction de la quantité de texte UILabel] (http://stackoverflow.com/questions/36544115/increase-height-of-tableview-cell-accord-to-amount-of- uilabel-texte) –