IPhone : Use Adaptive Layout programmatically to resize static cells height for hCompact

on Sunday, April 19, 2015

In a portait-only word game I use static cells to display an IAP store:


iPhone screenshot


You can see my problem in the iPhone 4 screenshot above - the pink button (to watch video ads and receive 150 coins) at the bottom is not visible.


Here is my Xcode screenshot (please click for fullscreen):


Xcode screenshot


I use 7 static cells - for everything, including the Back button at the top and the status text label (not visible) - an resize the cells with this method:



- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath
{
if ([indexPath row] == 0)
return 70;

if ([indexPath row] == 1)
return 35;

return 90; // XXX how to change this to 70 for hCompact?
}


My question is: how to resize the cells height programmatically for devices with compact height (called hCompact in Adaptive Layout).


0 comments:

Post a Comment