Ich habe eine benutzerdefinierte UITableViewCell
mit einer Textansicht.UITableViewCell Höhe kann nach textView dynamisch nicht erhöht werden
Die textView-Höhe erhöht sich entsprechend ihrem Text.
Ich kann nicht herausfinden, wie man die Zellenhöhe erhöht, um der Textansicht zu entsprechen.
Hier ist mein 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;
}
Possible Duplikat [Höhe tableview Zelle erhöhen nach Menge des UILabel Text] (http://stackoverflow.com/questions/36544115/increase-height-of-tableview-cell-according-to-amount-of- Uilabel-Text) –