I've hit a weird problem with UITabBarController
on iOS7 and can't seem to find a workaround, so any help would be welcome!
Scenario:
- Navigation-based app using landscape orientation on iPad.
- App consists of a main view, and a second view which is a UITabBarController.
- TabBarController has two tabs.
- First view has two buttons - each button performs a segue to the tab bar controller and sets a different tab as selected. (i.e. button1 selects the first tab, and button2 selects the second tab).
- Setting the tab is done in
prepareForSegue
by callingsetSelectedIndex
on the tab bar controller.
Outcome:
On iOS 7 I am finding that the view shown in the tab bar controller fails to register any touch events along the right-hand edge of the view! So in the storyboard shown above, the UISwitch on the right side of the screen cannot be tapped.
I've even attached a tap gesture recognizer to the views and used it to log the area of the screen that can be touched - it seems to register touch events up to about x=770 points across. The remaining 1/4 of the screen is 'untouchable'!
After the segue, if you manually switch to the other tab and switch back again, the touch events are 'fixed' and the full view responds to touches again.
This doesn't seem to be a problem on iOS 5 / 6.
Any help much appreciated as to:
- What is causing this to happen in the first place (iOS7 bug / change?)
- How else can I work around this? I've tried calling
setSelectedViewController
as well as usingsetSelectedIndex
and this seems to be the same.
Thanks in advance.