Custom table view table does not change depending on size

I created a new custom TableViewCell by subclassing UITableViewCell. I created a table view with a UIImage view using the tip and I connected it to the viewpoints. Then, populating the table from my TableView delegate, I used a subclass for the display cells of the return table.

New content is being downloaded from nib. But the new cell size of the custom table view (I changed the size of the table cell to a new large size) does not load into the table view.

Am I missing any call during rendering? Please, help

@interface AccountOption : UITableViewCell { IBOutlet UIImageView* optionIcon; } @property (nonatomic, retain) IBOutlet UIImageView* optionIcon; @end 

In the delegate

  NSArray* topLevelObjects = [[NSBundle mainBundle] loadNibNamed:@"AccountOption" owner:nil options:nil]; for (id currentCell in topLevelObjects) { if ([currentCell isKindOfClass:[AccountOption class]]) { cell = currentCell; } } cell.optionIcon.image = [(NSDictionary*)[accountOptions objectAtIndex:indexPath.row] objectForKey:@"icon"]; return cell; 
+4
source share
2 answers

You need to set the row height of the table view both in the interface builder and in the code in the view controller or in the table delegate tableView:heightForRowAtIndexPath:

+7
source

The size of a cell is determined by its UITableView. A table has a delegate property and method that determine the height of a cell (row). The width of the cell is always equal to the width of the table. You can try to resize the cell manually, but it will always be overwritten by the table.

The height property is [UITableView rowHeight] , and it is preferable to set the height value according to the delegate method of the tableView:heightForRowAtIndexPath: table tableView:heightForRowAtIndexPath: The delegate method should only be used when you need different cells for different heights.

+3
source

All Articles