Question

I know how to set the width of something like the navigation bar, for ipad mini CGRectMake(0,0,748,100) for example for a custom navigation bar, however the resolution for the ipads width is around double that, is there a way that will work on either device?

Was it helpful?

Solution

This will give you width in points:

[UIScreen mainScreen].applicationFrame.width

You can get width in pixels multiplying it by [UIScreen mainScreen].scale

OTHER TIPS

You can use autoresizingMask:

navControl.navigationBar.autoresizingMask = UIViewAutoresizingFlexibleWidth;
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top