Delgado Delgado - 20 days ago 5
iOS Question

Monotouch / Xamarin changing the table row height for iPad applications

I am having trouble figuring out how to change the

rowHeight
for the tables in my
Xamarin
iPad application. Previously I've worked on iPhone apps and adjusting the size of the rows were as simple as calling the following in the
TableSource
Class:

public override float GetHeightForRow (UITableView tableView, NSIndexPath indexPath)
{
return 95f;
}


However, I'm finding out that this is not being called in the iPad app. Is there another method I should be calling or am I just going about this completely wrong?

Answer

It looks like you are doing it correctly by overriding GetHeightForRow, but if its not changing it I'd suggest checking your ViewDidLoad method on the controller to make sure it's setting the tableview source to your custom tableSource class.

For example, in ViewDidLoad:

_tableview.Source = new TableSource();