Search code examples
iphoneiosuiswitch

UI looks different on iOS 5 an iOS 4.3


I have UISwitch on my vie, loaded from xib. It's x position is bigger then zero and it looks ok on iOS 5 simulator. But when I try to run it on 4.3 simulator it looks like UISwitch's position is equal to zero

Where is my problem?


Solution

  • As well as their change in appearance, UISwitches have shrunk between iOS 4 and 5. Based on quick screenshot comparison, they were about 94pt wide and are now only 76pt. So if you have a switch that is, say, right aligned per the autosizing mask then it will extend further to the left in 4 than in 5.

    Sadly there's very little you can do about that other than designing for 94pt widgets and accepting a bit of extra empty space under 5. Because the interface builder positions all things at exact pixel positions, rather than applying a layout logic, it's quite possible you'll have to do some manual programmatic adjustment.