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
1
vote
1 answer

Generic or Single uipickerview to show in multiple viewControllers

I want to know how can i make a generic/single UIPickerView to display in multiple ViewControllers. I want to show a pickerView in multiple ViewController. Now how can i create it. I know how to create it like implement and write its delegate for…
Zar E Ahmer
  • 33,936
  • 20
  • 234
  • 300
1
vote
1 answer

UIPickerView does not display data in iOS 7

I'm using a UIPickerView and an UIToolbar, and adding it to a UIView and adding this view to my main view addTimePicker=[[UIPickerView alloc]init]; [addTimePicker setFrame: CGRectMake(0, 20, 0,…
1
vote
1 answer

uipickerview textcolor issue and color brightness issue

For my uipickerview I have: - (UIView *)pickerView:(UIPickerView *)pickerView viewForRow:(NSInteger)row forComponent:(NSInteger)component reusingView:(UIView *)view { CGSize size = [pickerView rowSizeForComponent:0]; UILabel *labelMain =…
Paul T.
  • 4,938
  • 7
  • 45
  • 93
0
votes
1 answer

Pickerview is showing empty on second click in the textfield, adn when i press Done or Cancel the App crashes

var gender = ["MALE","FEMALE", "Other"] var genderPicker: UIPickerView! = UIPickerView() // On the first click in the textfield the gender pickerview works fine, but if i press out and then i press again in the gender textfield the picker appears…
0
votes
2 answers

Passing updated array data to uipickerview

Still pretty new to swift, I was having some trouble passing updated data into the pickerview. I'm receiving the "index out of range" error. I have a suspicion that the uipickerview is seeing the empty array, even though the arrays are getting…
0
votes
2 answers

How conform to UIPickerViewDelegate and UIPickerViewDataSource outside of a ViewController?

I want to have multiple UIPickerViews in one scene without bloating my view controller with delegate functions. All the tutorials I've seen on UIPickerViews suggest using the view controller itself as the delegate of a UIPickerView. How can I move…
0
votes
0 answers

pickerView:didSelectRow:inComponent getting called twice with VoiceOver

I'm not sure what I'm missing here, but when you select a picker view row with VoiceOver pickerView:didSelectRow:inComponent gets called twice. Without voice over it gets called once. I've tried this on a brand new project with bare bones…
0
votes
3 answers

How can i reach of selected item's title and item's value in picker in swift?

Let me describe view controller (page design) side first. I added one picker view, one label and one button, here is my viewController file import UIKit class ViewController: UIViewController, UIPickerViewDelegate, UIPickerViewDataSource { …
0
votes
2 answers

Reloading Particular Row of PickerView in swift

I have a pickerView consisting of a label and image. i'm updating that image when pickerview is tapped on that particular. but to show the change of image i have to reload pickerView. and when i reload it goes back to the first row. is there any way…
0
votes
1 answer

How can I clear one of pickerView from two?

I'v got two pickerViews and when user select first after the second pickerView is loading. But if user does it again this action, all datas appending to second pickerView. I have to clear second pickerView content when user select first one. I am…
0
votes
2 answers

UIPickerView not showing images in iOS 7 + versions

I'm trying to run my app in iOS 7+ versions wherein struck with one issue I have UIPickerview showing images correctly for versions lessthan iOS 7 but in iOS 7+ entire picker view is messed up. Here's what im trying to achieve I have array of…
Ashh
  • 569
  • 1
  • 6
  • 28
0
votes
1 answer

UIPikerViewController for ios 10

I wrote code about a year ago, where I load photo or picture to network. But now this code not working. I think it is connected to that now I use IOS 10. In logs : [Generic] Creating an image format with an unknown type is an…
0
votes
1 answer

How to return selected value in UIPickerDelegate when created programatically

I have a viewController that has a bunch of inputs on it. Some of them are normal text but some require input from a picker. I decided to move the implementation of each PickerDelegate and PickerDataSource into a separate file to keep things a…
0
votes
1 answer

Swift 2 - UIPickerView values of two components

I have a UIPickerView with two components, when I change component[0] the data of thecomponent[1]` is reloaded. Now I am trying to get the values of both components in one string using didSelectRow however, I cannot get the result I want. public…
SNos
  • 3,430
  • 5
  • 42
  • 92
0
votes
1 answer

Multiple UIPickerview Errors

I just wanna let you know that the version of Xcode that I'm working on is 7.1.1. Getting to the point, I have three Pickerviews as is shown in the image below. Main pickerview, left pickerview, and right pickerview. The array of main pickerview…