Questions tagged [uipickerviewdelegate]

The delegate of a UIPickerView object must adopt this protocol and implement at least some of its methods to provide the picker view with the data it needs to construct itself.

The delegate of a UIPickerView object must adopt this protocol and implement at least some of its methods to provide the picker view with the data it needs to construct itself. On UIPickerViewDelegate, you can find the following methods:

Setting the Dimensions of the Picker View

– pickerView:rowHeightForComponent:

– pickerView:widthForComponent:

Setting the Content of Component Rows

The methods in this group are marked @optional. However, to use a picker view, you must implement either the pickerView:titleForRow:forComponent: or the pickerView:viewForRow:forComponent:reusingView: method to provide the content of component rows.

– pickerView:titleForRow:forComponent:

– pickerView:attributedTitleForRow:forComponent:

– pickerView:viewForRow:forComponent:reusingView:

Responding to Row Selection

– pickerView:didSelectRow:inComponent:

39 questions
0
votes
1 answer

Regarding Multiple UIPickerview

I have three Pickerview as it shown in the image below. I main pickerview, left pickerview, and right pickerview. The array of main pickerview has group of names, and each name has group of units. I have made array inside array in order to show…
0
votes
1 answer

Picker view does not return always the right value

I've defined a picker which does not return always the right value. Sometimes it just works but most of the time when I pick the item pickerView returns the wrong value. I did associate the outlet delegate to the view controller and am using the…
narb
  • 958
  • 1
  • 13
  • 39
0
votes
1 answer

Using NSObject for a UIViewDelegate instead of a UIViewController

I have the following class that I want to use as my UIPickerViewDelegate class TimePickerViewDelegate: NSObject, UIPickerViewDataSource, UIPickerViewDelegate { let pickerData = ["Mozzarella","Gorgonzola","Provolone","Brie","Maytag Blue","Sharp…
0
votes
1 answer

Swift: How to assign different number values to rows in a UIPickerView?

I have an array representing the rows of a UIPickerView: var exerciseArray = ["Sitting","Walking","Bowling","Biking Slow","Biking Fast","Golf","SoftBall","BaseBall","Weight Training","Ice…
user4241521
0
votes
1 answer

Creating a delegate and dataSource for UIPickerView

I am trying to create a delegate and a dataSource for a UIPickerView in a separate file. In the ViewController i have: - (void)viewDidLoad { [super viewDidLoad]; UIPickerView *myPickerView = [[UIPickerView alloc] initWithFrame:CGRectMake(0,…
0
votes
3 answers

How to swap between UIViews inside a UIViewController?

I have created 8 UIViews, I have a UIPicker and when the user selects something with the UIPicker I run the thread though a big if statement which I am not happy about. I would like to know if what I am doing is okay? and also if the code I am…
HurkNburkS
  • 5,492
  • 19
  • 100
  • 183
0
votes
2 answers

UIPickerView inside a Custom UITableViewCell

I have a custom UITableViewCell where I have a UIPickerView inside it. To manage that, I've created a Subclass where I implemented the UIPickerView delegate and datasource methods. When the cellForRowAtIndexPath I implemented like this: -…
Marcal
  • 1,371
  • 5
  • 19
  • 37
0
votes
1 answer

Static view for center row in a UIPickerView

I have a pickerView to which I add a custom view to each row by viewForRow delegate method. The goal here is to have a different view for the center(selected) row like a highlight view WHILE the pickerView spins (a center static view). Any help…
snksnk
  • 1,566
  • 4
  • 21
  • 46
0
votes
1 answer

how to change elements on UIpickerView pushing a button or pushing another button

I have an application, that in the main view, have 3 buttons, and the 2 firts buttons have to show an UIPickerView for a selection of event (one of them) and a selection of time (the second). UIPickerViewDelegate only let me to implement the methods…
1 2
3