Hide UITabBar when displaying UIPickerView in iPhone SDK

I have a view when I want to use UIPickerView, but my application also supports UITabBar. I want to display the UIPickerView in the same place the keyboard appears, but the problem is that when I do these buttons on the tab bar above the selection, only half of them are beign. Is it possible to temporarily disable the tab bar before drawing the collector and restore it when the collector disappears?

+3
source share
2 answers

Can you show us how you show UIPickerView? I assume that you add it as a sub-view to the view controller, which is displayed on the tab bar, and set its frame so that it is the same as the keyboard.

In this case, try adding UIPickerViewas a sub-view to the window, and not the view controller view:

[[[UIApplication sharedApplication] keyWindow] addSubview:myPickerView];

This should show it above all other views.

One possible warning is that if the keyboard should be displayed at any time while your pickerview is in place, the keyboard will appear above your choice, hiding it until the keyboard is canceled.

+8
source

What if you called

myTabBarController.tabBar.hidden = YES;

before showing this view of choice?

+2

Source: https://habr.com/ru/post/1732194/


All Articles