I am trying to change the height of a UITextView that I have in a custom made cell for my tableView.
"Browse Cell" is the identifier of this custom cell at the tip, and the UITextView "postIntro" is dragged into nib.
Unfortunately, the height does not change, only after I scroll the height has changed. Cells that are visible without scrolling are only the default height from nib.
When I try to change the height of "postImage", the same problem occurs.
This is my code:
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { static NSString *CellIdentifier = @"OverviewCell"; OverviewCell *cell = [self.tableView dequeueReusableCellWithIdentifier:CellIdentifier forIndexPath:indexPath]; Post *post = [self.posts objectAtIndex:[indexPath row]]; if(!cell) { NSArray *topLevelObjects = [[NSBundle mainBundle] loadNibNamed:@"OverviewCell" owner:nil options:nil]; for(id currentObject in topLevelObjects) { if([currentObject isKindOfClass:[OverviewCell class]]) { cell = (OverviewCell *)currentObject; break; } } } [[cell postImage] setImage:[UIImage imageWithData:post.image]]; [[cell postTitle] setText:post.title]; [[cell postIntro] setText:post.intro];
Any other suggestions for my code are welcome ...
source share