0

enter image description here

as you can see, my UIPickerView is in back a Tab bar, how to make it in front them? i'm using swift

and also my done button doesn't work to hide the UIView that contain UIPickerView, i'm sure the button connected to an action

here's my doneButton action

@IBAction func doneButtonTapped(sender: AnyObject) {

    self.viewUIPickerView.viewWithTag(1)?.hidden = true

}
Ariel Gemilang
  • 796
  • 2
  • 20
  • 42
  • Please look [answer](http://stackoverflow.com/a/13193277/3116236) Hope this help – iSashok Jun 08 '16 at 05:44
  • I think this may help you. kindly refer this link, [enter link description here](http://stackoverflow.com/questions/3252664/hide-the-tab-bar-in-a-tab-bar-application) – NewbieiOS Jun 08 '16 at 08:41
  • This may help you, refer this link. http://stackoverflow.com/questions/3252664/hide-the-tab-bar-in-a-tab-bar-application – NewbieiOS Jun 08 '16 at 08:42
  • This may help you, refer this link http://stackoverflow.com/questions/3252664/hide-the-tab-bar-in-a-tab-bar-application – NewbieiOS Jun 08 '16 at 08:44

4 Answers4

2

Solution 1> you are open pickerview that uitabbar hidden and pickerview hidden that uitabbar show. For Example:

if (pickerview.hidden == true)
   self.tabBarController.tabBar.hidden = false
else
   self.tabBarController.tabBar.hidden = true

or

self.tabBarController.tabBar.hidden = !pickerview.hidden

Solution 2> set your pickerview frame perfect:(for example)

self.pickerview.frame = CGRectMake(0,[UIScreen MainScreen].bound.size.height - self.pickerview.frame.size.height,self.pickerview.frame.size.width,self.pickerview.frame.size.height);
Bhadresh Kathiriya
  • 3,147
  • 2
  • 21
  • 41
1

When evere you try to open picker simply hide the tabbar like this

self.tabBarController.tabBar.hidden = true

onClick of done show the tabbar agian

self.tabBarController.tabBar.hidden = false

Hope this will help you.

Nirav D
  • 71,513
  • 12
  • 161
  • 183
  • Thanks! I feel so stupid didn't realize it. But for some reason my done button doesn't perform an action, i'm pretty sure it's connected to the outlet – Ariel Gemilang Jun 08 '16 at 05:57
  • `@IBAction func doneButtonTapped(sender: AnyObject) { self.viewUIPickerView.viewWithTag(1)?.hidden = true self.tabBarController!.tabBar.hidden = false }` – Ariel Gemilang Jun 08 '16 at 05:57
  • Please edit your question and add some code of done button click and pickerview. – Nirav D Jun 08 '16 at 06:01
1

Because of UITabBar on top of your ViewController. You can do one of following:

  1. Hide Tabbar.
  2. Add pickerView as subView of tabbar
  3. Add pickerView on top of tabbar.
Trung Phan
  • 923
  • 10
  • 18
1

this may help you

//Navigation bar:

self.navigationController.navigationBarHidden = YES;

//Statusbar:

[[UIApplication sharedApplication] setStatusBarHidden:YES];

//Tabbar:

self.tabBarController.tabBar.hidden = YES;
NewbieiOS
  • 81
  • 1
  • 1
  • 11