0

I want to implement multiple pickerView (combobox) on my form, but the pickerView implemented on xcode is too bigger, and that's the only one we can use, so I want to know if we can customize the UIPickerView like a field when we tap a picker view appear. I want something light, because here the UIPickerView take a lot of place on my view.

rmaddy
  • 314,917
  • 42
  • 532
  • 579
Ben
  • 761
  • 1
  • 12
  • 35
  • 1
    If I understood you correctly, you don't want the picker view to be visible at all times. You can achieve this by assign a picker view to any responder's `inputView`. If that responder then becomes the first responder, the picker view will be shown in lieu of the keyboard. – Christian Schnorr Nov 24 '15 at 14:46
  • @ChristianSchnorr Ye sor a dropdown list view like in android, I'll look on your proposition – Ben Nov 24 '15 at 15:02

1 Answers1

0

How to change UIPickerView height

please check this in iOS9 picker view rect is changeable.

form iOS 9 release notes.

UIPickerView and UIDatePicker are now resizable and adaptive—previously, these views would enforce a default size even if you attempted to resize them. These views also now default to a width of 320 points on all devices, instead of to the device width on iPhone

https://developer.apple.com/library/prerelease/ios/releasenotes/General/RN-iOSSDK-9.0/

Community
  • 1
  • 1
  • Yes but the height is not the real problem, if I set a little height, change the item will be difficult by not seeing the other items. I want to have an another style of picker view like a drown down list like in android – Ben Nov 24 '15 at 15:05
  • http://stackoverflow.com/questions/21900315/ios-drop-down-view Ben have a look at this answer there are some open source libraries which implement your need. If you really wants a perfect dropdown list then i think you have to implement yourself. – Muhammad Zohaib Ehsan Nov 24 '15 at 15:16
  • I prefer to don't use library, I'm gonna see something by using uitextfield and appear a uipickerview on tap you think it's possible ? – Ben Nov 24 '15 at 15:19
  • yep why not. Tapping on text field , create a picker view and add it just below the textfield, on selecting a row in picker view hide it. Or depends upon your need. :) – Muhammad Zohaib Ehsan Nov 24 '15 at 15:21