Questions tagged [uipickerview]

The UIPickerView class implements objects, called picker views, that use a spinning-wheel or slot-machine metaphor to show one or more sets of values. Appears on iOS.

UIPickerView is part of the UIKit Framework and is available in iOS 2.0 and later. The UIPickerView class implements objects, called picker views, that use a spinning-wheel or slot-machine metaphor to show one or more sets of values.

Picker views can have multiple components, each of which can select independent values.

References:

3356 questions
164
votes
15 answers

Hide the cursor of a UITextField

I am using a UITextField with a UIPickerView for its inputView, so that when the user taps the text field, a picker is summoned for them to select an option from. Nearly everything works, but I have one problem: the cursor still flashes in the text…
emenegro
  • 6,901
  • 10
  • 45
  • 68
120
votes
11 answers

Add UIPickerView & a Button in Action sheet - How?

My application requires following things to be added in an action sheet. UIToolbar Button on UIToolbar UIPicker Control I have included an image to understand my requirements. Could you please explain, how this can be implemented?
sagarkothari
  • 24,520
  • 50
  • 165
  • 235
118
votes
27 answers

How to change UIPickerView height

Is it possible to change the height of UIPickerView? Some applications seem to have shorter PickerViews but setting a smaller frame doesn't seem to work and the frame is locked in Interface Builder.
Steven Canfield
  • 7,312
  • 5
  • 35
  • 28
118
votes
8 answers

How do I change the color of the text in a UIPickerView under iOS 7?

I'm aware of the pickerView:viewForRow:forComponent:reusingView method, but when using the view it passes in reusingView: how do I change it to use a different text color? If I use view.backgroundColor = [UIColor whiteColor]; none of the views show…
Doug Smith
  • 29,668
  • 57
  • 204
  • 388
116
votes
17 answers

How to disable UITextField editing but still accept touch?

I'm making a UITextField that has a UIPickerView as inputView. Its all good, except that I can edit by copy, paste, cut and select text, and I don't want it. Only the Picker should modify text field. I've learned that I can disable editing by…
Luiz de Prá
  • 1,475
  • 2
  • 12
  • 23
86
votes
6 answers

How to make an UIPickerView with a Done button?

I am having difficulties to make an UIPickerView with a done button to appear when the users taps a UITextField. This is my code so far. Everything builds fine, but when I tap the text field, the keyboard appears, not the picker. class…
Alberto O.
  • 835
  • 1
  • 8
  • 14
78
votes
6 answers

Select row After UIPickerView is loaded

I have an iPhone database app that loads a UIPickerView with data from a table. I want to set the selected row to a particular row from the data in another table. For example: Let's say I have a UIPickerView that is loaded with X number of names of…
Steve Gibson
  • 801
  • 1
  • 7
  • 7
68
votes
9 answers

Add image to UITextField in Xcode?

I need to implement the concept of dropdown in Xcode. For that purpose, I'm using a UIPickerview. This pickerView loads when a textfield is tapped (on textFieldDidBeginEditing:)event. Question: Is there a way, that I can add a image to TextField?…
Honey
  • 2,840
  • 11
  • 37
  • 71
68
votes
8 answers

How to set a default Value of a UIPickerView

I have a problem with my UIPickerView. I have 3 values in it EU AP and NA. When I start the app EU seems to be selected but when I make a NSLog(@"%@", [regions objectAtIndex:row]); I only get back (null), now when I touch the UIPickerView the EU…
Chris
  • 709
  • 2
  • 6
  • 9
66
votes
6 answers

How do I reload/refresh the UIPickerView (with new data array) based on button press?

IF I wanted a picker, for states/provinces, i haven't seen an example, but I mocked up shown above, a picker for US/Can/Mex. wondering can you dynamically switch the NSMutableArray for the UIPickerView and then have it somehow reload each time you…
jim4iOS
  • 685
  • 1
  • 5
  • 4
64
votes
13 answers

How to change the Font size in UIPickerView?

I have one UIPickerView. This is having nearly 200 items, each items has long texts, so, i want to resize the UIPickerView's font size. How can i change it? It is possible? Can any one help me? Thanks ! Yuva.M
Yuvaraj.M
  • 9,741
  • 16
  • 71
  • 100
51
votes
6 answers

Add UIPickerView in UIActionSheet from IOS 8 not working

I am adding UIPickerView to UIActionsheet but its working perfectally in ios 7 but not working in ios 8. Please help me to solve that. Here i attached screenshot for that. Thanks I am using following code for that. UIActionSheet…
Jignesh Patel
  • 755
  • 1
  • 8
  • 10
50
votes
4 answers

Source type 1 not available

I have an app for iPhone and iPad, and when I try to load an UIPickerViewController in a UIPopoverController for iPad I get the Exception "Source type 1 not available". getting the problem even though using the device. @try { if…
47
votes
5 answers

Can I programmatically scroll to a desired row in UIPickerView?

By default the first row is highlighted after initializing the UIPickerView. How do i highlight a particular row or scroll to particular row programmatically?
pradeepa
  • 4,104
  • 5
  • 31
  • 41
46
votes
8 answers

UIPicker detect tap on currently selected row

I have a UIPickerView and The method didSelectRow is not called when tapping on a selected row. I need to handle this case. Any ideas?
Royce
  • 461
  • 1
  • 4
  • 3
1
2 3
99 100