1
votes

there´s the new function called size classes to design once for every device. So i designed my Views in Compact Width and Regular Height, to support all iPhones in Portrait mode.

enter image description here

But what if i want to have one thing different on 3.5 inch devices?! How can i do that?I already tried to change the size class, but there´s no class especially for 3.5 inch devices...

1
Did you try compact height? or use AnyHeight with ScrollView ?aelam

1 Answers

0
votes

Size classes are for categories of devices, not individual devices themselves. This means that you can't design specifically for 3.5-inch screens by using a size class.

You will have to use something like the following to check if your app is running on a 3.5-inch screen:

#define IS_IPHONE_4  ( fabs( ( double )[ [ UIScreen mainScreen ] bounds ].size.height - ( double )480 ) < DBL_EPSILON )

...and then update the position of your desired view - either by settings its frame or updating its constraints.