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
20
votes
3 answers

How to disable UIPickerView (Objective-C)?

Is there a way to make the UIPickerView read-only? This means that the user cannot flip through the options. PS. This is not the same as not passing anything in the didSelectRow method because I only want the user to see that the picker is there and…
erastusnjuki
  • 1,491
  • 3
  • 14
  • 32
19
votes
8 answers

Hiding/ Showing UIPickerView

I Have an a touchesEnded event that checks for when a UITextField is pressed. What I would like it to do is is hide/show a UIPickerView. How can this be done? - (void)touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event{ UITouch *touch =…
aahrens
  • 5,522
  • 7
  • 39
  • 63
19
votes
8 answers

display done button on UIPickerview

I have written the following code in the viewDidLoad method: categoryPickerView=[[UIPickerView alloc]init]; categoryPickerView.alpha = 0; [self.view addSubview:categoryPickerView]; categoryPickerView.delegate=self; categoryPickerView.tag=1; and…
iOS i'm loving It.
  • 309
  • 1
  • 2
  • 11
18
votes
9 answers

Change UIPickerView background

I want to change the border color of a UIPickerView. I do not see a tint property for the UIPickerView. Is there any way this could be done? Or a workaround? Thanks.
lostInTransit
  • 70,519
  • 61
  • 198
  • 274
18
votes
5 answers

Default UIPickerView height

How can I programatically obtain the default height of an UIPickerView instance, in accordance to the resolution and orientation of the device that the app is currently running on? I would like not to use a hardcoded value for this parameter, in the…
luvieere
  • 37,065
  • 18
  • 127
  • 179
18
votes
6 answers

Assertion failure in -[UIPickerTableView _createPreparedCellForGlobalRow:withIndexPath:], /SourceCache/UIKit_Sim/UIKit-2903.2/UITableView.m:7768

I am trying to show UIPickerView with UIToolBar but getting some error. Here is my code - CGRect toolbarTargetFrame = CGRectMake(0, self.view.bounds.size.height-216-44, 320, 44); CGRect datePickerTargetFrame = CGRectMake(0,…
iSmita
  • 1,292
  • 1
  • 9
  • 24
18
votes
2 answers

UIPickerView can't autoselect last row when compiled under Xcode 4.5.2 & iOS 6

I have been beating my head against the wall trying to diagnose my app's inability to automatically preselect the last row of a UIPickerView using code that successfully worked under older versions of XCode. I think this is a bug in Xcode rather…
user1819329
  • 411
  • 3
  • 9
17
votes
2 answers

How can I set UIPickerView at other than the default index?

I have an integer having value of 5 and I want to start my UIPickerView with this index, now what should I do? normally UIPickerView is on default 0 index row, but I want it on index which is user defined, as can be 5, 6 or any other digit.
Chatar Veer Suthar
  • 15,541
  • 26
  • 90
  • 154
17
votes
7 answers

UIPickerView selection indicator not visible in iOS10

I build my project in Xcode 8. UIPickerView separator lines are not visible in iOS 10 simulator and the devices, but works fine on iOS 9.3 devices and simulator. I tried to adjust the UIPickerView back ground color, auto layouts and everything…
smartsanja
  • 4,413
  • 9
  • 58
  • 106
17
votes
4 answers

Showing UIPickerView with selected row

I am trying to figure out how to show the selected row when i open UIPickerView after it has been selected last time. When I open my PickerView again, I want my UIPickerView to set selected row which I choose at last time. Is there any way in Swift?
Thiha Aung
  • 5,036
  • 8
  • 36
  • 79
16
votes
1 answer

iPhone/iPad UI: seeking drop-down control

My universal app has a settings page, wherein the user must choose a theme from a dozen available themes. Problem is, if I am using a picker-view, it takes up most of the screen on an iPhone. I think what I want is something like your standard…
P i
  • 29,020
  • 36
  • 159
  • 267
16
votes
8 answers

Multi-Component Picker (UIPickerView) in SwiftUI

I'm trying to add a three-component Picker (UIPickerView) to a SwiftUI app (in a traditional UIKit app, the data source would return 3 from the numberOfComponents method), but I can't find an example of this anywhere. I've tried adding an HStack of…
Frank Schmitt
  • 25,648
  • 10
  • 58
  • 70
16
votes
3 answers

UIPickerView reloadData

I'm changing components (in particular, the number and color of components), in a UIPickerView that I call pickerOne, so after making the changes, I call: [pickerOne reloadData]; and it appears to be working perfectly however, I'm getting a compile…
Matt Winters
  • 1,099
  • 2
  • 12
  • 22
16
votes
2 answers

UIPickerView - Loop the data

I'm currently developing an app using Swift where I use a UIPickerView, see below for image. Currently the UIPickerView stops when the user has scrolled to the last data, but i want it no never stop. I want it to be possible to start from the first…
ThomasGulli
  • 604
  • 1
  • 7
  • 20
16
votes
3 answers

UIPickerView in UITableView

First of all: I know that some people already posted topics like that, but nobody gave a clear answer in all those topics. I have a settings-UITableView in my application. Now i want to add a TableViewCell where i can choose between some numbers…
Mike_NotGuilty
  • 2,253
  • 5
  • 32
  • 64