1

I'm working on a universal app and the view I'm working on is common to iPhone and iPad. I display a UITableView (with grouped style) and I made a custom cell (programmatically - no nib). I read somewhere (can't find where anymore) that the margins are of 1/16 * width of the table. So I set the width of my custom cell to 14/16 * width of the table but that's not good. Or at least it doesn't work well.

Can someone confirm or invalidate that the margins are 1/16 * width of the table?

And in the case that's not 1/16, how can compute that size?

Alexis
  • 16,629
  • 17
  • 62
  • 107

2 Answers2

2

iPhone portrait margins : 10 pixels
iPhone landscape or iPad margins:
- if table width<400 then 10 pixels
- else margin = 6% of table width, with minimum of 31 pixels, max of 45 pixels

JP Hribovsek
  • 6,707
  • 2
  • 21
  • 26
0

I believe the default horizontal margin is 10 pixels. But you could use auto resizing, eg UIViewAutoresizingFlexibleWidth. Look at the UIView documentation.

elk
  • 31
  • 6