When I edit the xib file, the UIPickerView occupy a very large space, kind of annoying, how can I hide it when I do not want to see it?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You can’t “hide” it from Interface Builder, but there are two or maybe three things you can do to make it less distracting for you.
1)
Change the order in which it appears in your ViewController to be the highest (or actually the deepest), so it’s behind everything else. Then all other controls or views you put over the Picker will be “on top” of the Picker.
Here’s what it looks like in my Interface Builder:
2)
Set the “hidden” bit on the Picker object. This “dims” the Picker in IB, but at the same time don’t forget to UN-HIDE it programatically when it’s time for the object to appear.
3)
Or simply move the Picker out of the way of whatever you’re doing and then move it into position (whether manually in IB before compiling or programmatically at run time).