UITabbar still active under another UIView
I have a TabBar on the screen and a View with some buttons on it. When a button is clicked, I create a ViewController (with a view from a nib) and add it to the keywindow of the application. I put this view offscreen and start an animation to make this new view slides from the bottom of the screen, and cover the tabBar. On this new view there is a UIPicker and 2 buttons (select / cancel). When one of this buttons is clicked, the PickerView slide off the screen and his controller is dealloc.
This works fine except for one thing : if I click on the zone where the tabBar is located and hidden by my new view, the tabBar get the click event !
How can I make the tabBar non responsive ? (Remember that I don't push the new view) Or maybe it isn't the right way to do this ?
EDIT & ANSWER : The problem came from the fact that I did a mistake in the height setting. I typed 160 instead of 260. [myPickerController.view setFrame:CGRectMake(0, 480, 320, 260)]; The last 100 px, even i开发者_如何转开发f displayed, where "transparent" to event and get transfered to the TabBar who stands in that zone (even if it was hidden).
I am not sure but why don't you try
yourTabbar.userInteractionEnabled = NO;
when the view is visible. Make sure you set
yourTabbar.userInteractionEnabled = YES;
when view is dismissed.
You should use method named in your application:
tabbar1.hidesBottomBarWhenPushed = YES;
精彩评论