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
29
votes
4 answers

Show UIPickerView text field is selected, then hide after selected

I am trying to create a text box that when it is selected a UIPickerView opens up with choices to select from. Once selected, the UIPickerView hides and the selected item is displayed in the text box. I tried different pieces of code I found online…
TimberWebDesign
  • 365
  • 2
  • 4
  • 10
29
votes
3 answers

UIPickerView as inputView of UITextField

I've read a lot about how I can use a UIPickerView as the inputView of my UITextField. The thing is, I am able to call the UIPickerView when I tap on the UITextField. However, my app always loads with the UIPickerView shown. I have already tried…
SilverHood
  • 713
  • 1
  • 8
  • 15
27
votes
2 answers

UIPickerView best practice?

One short question: on a registration process I would like to ask the user to choose a value from a list of values. Is it the right way to use a view Controller adding there all text fields and for the values a picker view? As the picker view needs…
user1555112
  • 1,897
  • 6
  • 24
  • 43
24
votes
1 answer

swift UIAlertController with pickerView button action stay up

I am new in swift and I am trying to make UIAlertContoller with PickerView but I have problems with the Buttones, Here a photo I am trying to change the constraint of the buttons to stay up. I read a lot of answers here but I did not find any…
Sahar Vanunu
  • 345
  • 2
  • 5
  • 19
24
votes
2 answers

Assertion failure on picker view

I'm getting an assertion failure while scrolling a picker view w/ zero data(zero rows). While scrolling the picker view I'm getting this crash. Testing on iOS 6 * Assertion failure in -[UITableViewRowData rectForRow:inSection:],…
Manoj
  • 953
  • 2
  • 8
  • 24
23
votes
5 answers

How do you shrink a UIPickerView on the iPhone?

I would like to reduce the height of a UIPickerView in my iPhone app, so that it shows only one row and one column. The height of the picker view should be equal to the height of a row. I'm using Interface Builder to construct the UIPickerView, but…
Rahul Vyas
  • 28,260
  • 49
  • 182
  • 256
23
votes
5 answers

How to change the UIPickerView text color?

The default UIPickerView color for text is black. There has been some updates to the language in Swift4. I have found my own solution and answered below.
Steve B
  • 861
  • 1
  • 7
  • 9
23
votes
2 answers

How do I change the font size in a UIPickerView in Swift?

How do I change the font size in a picker view? I have read a lot of questions about this, but none are in Swift 3. I have three picker views; the first two have two columns and have the same data source and delegate. The last one has one column…
TonyStark4ever
  • 848
  • 1
  • 9
  • 24
22
votes
11 answers

How to change color of selected row in UIPickerView

Ok, maybe I'm missing something really simple and I apologize if that's the case, however, I've googled every permutation of the title and have not found! So this is simply what I want to do: change the background color of the label I'm using as…
ennuikiller
  • 46,381
  • 14
  • 112
  • 137
22
votes
5 answers

UIPickerView - 1st row selection does not call didSelectRow

I have a UIPickerView on my UIView along with a UITextField. I am letting the user select a value from the picker or enter a custom value in the text field. When the user selects any option from the picker, the variable values are changed fine (in…
lostInTransit
  • 70,519
  • 61
  • 198
  • 274
22
votes
5 answers

Multiple UIPickerView in the same UIView

I'm a complete beginner on iOS dev and I want to create a little iOS application. On this application, 3 UIPickerViews are supposed to display different data. My problem is on the display. I'm used to dev on Android or Windows phone and I don't…
fselva
  • 457
  • 1
  • 7
  • 18
22
votes
2 answers

Get selected row in UIPickerView for each component

I have an UIPickerView with 3 components populated with 2 NSMutableArrays (2 components have the same array). A tutorial says: //PickerViewController.m - (void)pickerView:(UIPickerView *)thePickerView didSelectRow:(NSInteger)row…
user142019
22
votes
10 answers

How to make a circular UIPickerView (iPhone/iPad)?

I have had a look into this question a lot however I'm still unclear whether it's possible or not. Essentially what I want to do is to create a UIPickerView that is continuous in the sense that you can spin it forever and you will never reach the…
user843337
20
votes
8 answers

How to Show UIPickerView when selecting UITextField

Here is a screenshot of what I did till now: So what I am trying to do is when you select "pick a name" Textfield I need a Picker to show up, with the input @"Jack".
sillersam
  • 217
  • 1
  • 2
  • 5
20
votes
5 answers

How do I change the text color of UIPickerView with multiple components in Swift?

Below code will change the font colour of the picker view of all 3 components. However, it crash when I try to spin the wheel. I think it has to do with the didSelectRow function. Maybe the two function have to be nested somehow? Any idea? …
KML
  • 2,302
  • 5
  • 26
  • 47