开发者

Rescaling a UITableView for the iPad?

开发者 https://www.devze.com 2023-01-07 01:13 出处:网络
Recently, I have begun porting my iPhone app to the iPad and I have a view with a UITableView subview.Is there any way to rescale the table? The autoresizing masks don\'t blow up the font and I basica

Recently, I have begun porting my iPhone app to the iPad and I have a view with a UITableView subview. Is there any way to rescale the table? The autoresizing masks don't blow up the font and I basically just want a rescaled, crisp, larger version 开发者_运维技巧of the table for the iPad. Is there an easy way to go about doing this?


You could set cell.textLabel.font to a bigger one in cellForRowAtIndexPath:.

You could up the height of each cell by implementing heightForRowAtIndexPath:, e.g.

- (CGFloat)tableView:(UITableView *)tableView
    heightForRowAtIndexPath:(NSIndexPath *)indexPath 
{
    return 123.f;
}

Those are the ones I can think of, off hand.


you can set the table's rowHeight in the viewWillAppear.

self.tableView.rowHeight = 130.0;


Or use the UISplitViewController. The Tableview on the left and show the data, which should be displayed if you click one cell in the right view. ;-)

0

精彩评论

暂无评论...
验证码 换一张
取 消