Custom Cell Row Height Setting in Storyboard Is Not Responding

Custom Cell Row Height setting in storyboard is not responding

On dynamic cells, rowHeight set on the UITableView always overrides the individual cells' rowHeight.

But on static cells, rowHeight set on individual cells can override UITableView's.

Not sure if it's a bug, Apple might be intentionally doing this?

Row Height of UITableView Custom Cell doesn't update, Swift iOS8

You can update it with override this method in your TableViewController:

override func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat {
return 55
}

Cannot change the row height of TableViewCells - Swift

if you are using UITableViewController like this:

override func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat {
return 140.0
}

if you are using UIViewController, you must implement UITableViewDelegate

func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat {
return 140.0
}

Random table view cell height is not working perfectly

  1. You need to give label constraints from top and bottom, rather than center vertically.
  2. Give vertical content hugging priority

UITableViewCell: Custom Row Height for prototype cell

heightForRowAtIndexPath is called (for each row of the table) before the cells are displayed, i.e. before cellForRowAtIndexPath is called. That is necessary to compute the layout of the underlying scrollview, the scroll indicators etc.

UITableView custom cell not working on iPad Storyboard, but do on iPhone

I think you'll have to implement either the delegate method tableView:heightForRowAtIndexPath: or setting the rowHeight property on the tableView as explained here.

As to why it works on iPhone, perhaps it just happens to be a good size. Apple docs for rowHeight state:

If you do not explicitly set the row height, UITableView sets it to a standard value.



Related Topics



Leave a reply



Submit