uipickerview

Retrieving row index from UIPickerView and using it in a if statement

假如想象 提交于 2019-12-12 02:38:10
问题 Again forgive me if im not being clear, I have only started iOS dev yesterday. So I have a application that is going to send information to specific email address. I have included a pickerview and populated it with an array of information, 5 or 6 different categories. What i want to do is to be able to change the recipient's of the email based on what category is selected in the pickerview. So far I have but selectedRowInComponent doesn't seem to work. - (IBAction)sendFinalItem:(UIButton *

UIPickerView with two components crashes when scrolling both

我怕爱的太早我们不能终老 提交于 2019-12-12 02:35:07
问题 I have a UIPicker View with 2 components. The title for the rows of each component are in relationship, that is, the texts and number of the rows in the 2nd component will change according to the selected row in the 1st component. Now, the problem is, when I scroll the two components together, my app crashes. I guess the reason is that when the 1st component is being scrolled, the supposed number of rows in 2nd component keeps changing, but meantime, the UIPickerView is asking for the title

How to update a UITextField when receiving input from a UIPickerView?

随声附和 提交于 2019-12-12 02:27:53
问题 Currently, I am programmatically creating a UITextField and UIPickerView within cellForRowAt . I can easily update the selected UIPickerView value within didSelectRow if I connect my UITextField to an IBOutlet . However, I require the UITextField to be created programmatically with applied AutoLayout constraints. However, I don't know how to update the UITextField as I have no reference to it in the UIPickerView's didSelectRow function since it's created programmatically within cellForRowAt

UIPickerView hierarchy levels

为君一笑 提交于 2019-12-12 01:55:27
问题 I am would be greatful for some help in getting a swift solution of something 'similar' to this code which was done in Objective-C here. I basically want a picker with two components. I would like to be able to select a row in first component and on that basis of selected component in one column it shows the value of the corresponding data in the second. This would stop the endless scroll when searching for a specific football club. Data: Top Level: leagueName.text Second Level: teamName.text

How many maximum number of components can be there in UIPickerView?

僤鯓⒐⒋嵵緔 提交于 2019-12-12 01:44:44
问题 I was just wondering, how many components can be added to a UIPickerView ? 回答1: Technically, NSObject inherited objects can hold up to NSUIntegerMax objects (this is the largest value that can be returned from count). On a 32-bit system like the iPhone, that is a little over 4 billion. On a 64-bit system like most Macs/iPhone5S, it is many orders of magnitude higher. I suspect you will run out of RAM before you hit this CS limit. 来源: https://stackoverflow.com/questions/20241305/how-many

UIDatePickerView as Timer with more values

流过昼夜 提交于 2019-12-12 01:35:04
问题 The UIDatePicker with it's mode set on "Timer", only has values from 0 to 23 hours. I'd like to have more hours (like, up to 48 hours). It also shows a nice "floating" text next to the number on the selected row. I can actually "imitate" the "floating" hours effect, by adding a label on top of the UIPickerView, but I'd lose the second column with the minutes interval, and I'd really like to have 30 minute interval on a pickerView. But I really need more values on the hours column. Any

UIPicker and UIActionsheet no longer working iOS7

我怕爱的太早我们不能终老 提交于 2019-12-12 01:28:07
问题 Hi My UI Picker no longer works on iOS7, it pops up but it is blank. Only happened on iOS7. //picker -(void)pickerView:(UIPickerView *)pickerView didSelectRow:(NSInteger)row inComponent:(NSInteger)component{ animationsLabel.text = [optionsArray objectAtIndex:[picker selectedRowInComponent:0]]; if (pickerView==animationsPicker) { animationsLabel.text = [optionsArray objectAtIndex:[animationsPicker selectedRowInComponent:0]]; } } -(NSInteger)numberOfComponentsInPickerView:(UIPickerView *

Custom data source class for UIPickerView in Swift

孤者浪人 提交于 2019-12-12 00:38:39
问题 I wanted to create a separate data source class for UIPickerView like this: class PickerData : NSObject, UIPickerViewDataSource { // class definition goes here var pickerDataSource = ["White", "Red", "Green", "Blue"]; func numberOfComponentsInPickerView(pickerView: UIPickerView) -> Int { return 1 } func pickerView(pickerView: UIPickerView, numberOfRowsInComponent component: Int) -> Int { return pickerDataSource.count; } func pickerView(pickerView: UIPickerView, titleForRow row: Int,

Change UIPickerView font size for different column

痞子三分冷 提交于 2019-12-11 23:13:22
问题 I am constructing a UIPickerView, which works fine with my following code. //Title for Row - (NSString *)pickerView:(UIPickerView *)pickerView titleForRow:(NSInteger)row forComponent:(NSInteger)component{ if (component==kNumComponent) return Number[row]; else if(component==kSeaComponent) return Season[row]; else return Course[row]; } Where Number, Season and Course are the NSArray storing the string. Here I want to change the font size of course into smaller one. I learned some example here.

Inline UIPicker Implementation

妖精的绣舞 提交于 2019-12-11 22:06:50
问题 I'm attempting to implement an inline UIPicker inside a table-view cell, similar to both this and this SO question. I believe I'm close in my implementation, but at the moment, no picker is displayed when I select the appropriate cell. Can anyone point me in the right direction in regards to what I'm doing wrong? Thank you! Below is where I determine what rows occur in each section: - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { switch