How to make xib compatible with both iphone 5 and iphone 4 devices

前端 未结 14 1821
执念已碎
执念已碎 2020-11-28 20:39

I am trying to layout my xib so that layout fits in both iphone 5 (4 inches retina) and 3.5 devices.

Because I have to support IOS-5 I cannot use autolayout. I have

14条回答
  •  感动是毒
    2020-11-28 21:13

    ivanzoid's snippet above that queries for the whole screen size does the trick so long as you remember to subtract the offsets for navigation and toolbars (totalling 64 under most conditions).

    It's the view height that needs to be adjusted; springs and struts otherwise take care of it.

    Retesting my app on the iPhone 5 I only had to do this on one screen with some runtime control position adjustments. Every other case is handled by XIB defaults.

提交回复
热议问题