I am trying to make a button for the user where he will be able to choose between 5 different options. I have in mind something like an one line button where one option will be preselected and when the user presses the button the 5 options would be displayed for the user to choose. In the objects library the closest i can find to that is the picker view , but its too big for my screen and it displays all the options , as i only want one to be displayed in the beginning and when the user hits the button all the options so that he can pick a different one if he likes. Is there a button like this on xcode that i am missing or should i customize a picker view or something?
Share
One option would be a segmented control, but that gets too large when you have many options.
I’d recommend to use a customized UITextfield with a UIPickerView as inputView. So the user can only select the text from the picker, not through the keyboard.
It’s also possible to do that with a UIButton, that would require to subclass UIButton.
Here is a tutorial on how to achieve this: http://nomtek.com/tips-for-developers/working-with-pickers/