I am using a UISwitch in one of my tabbed applications. The UISwitch is on the bottom of the screen. When I first start the App, the switch works fine. I can rotate from portrait to landscape, everything works fine. I can even go to other tabs and come back and the switch still works in both landscape and portrait. However, if I go back and forth between tabs maybe five times, the switch works in portrait, but not landscape . Has anyone ever seen or heard of this? Anyone know of a reason this could happen? I have used
[infoSwitch setOn:NO];
in my viewWillAppear, so that the switch always starts OFF. Is there something I am missing about using a switch? I did the same things I have done in the past to get switches to work. Any help will be much appreciated! Thanks again.
UIView
s may be visible but will fail to get input if they're outside of the bounds of their parent view. So a first diagnostic would be to give the parent view some sort of obvious gaudy colour so that you can see its bounds visibly, then try your rotation and switching to see whether you can force an error there.
You can also set clipsToBounds
to YES
to ensure that views don't show subviews that are out of bounds.