uipickerview

UIPickerView - 1st row selection does not call didSelectRow

匿名 (未验证) 提交于 2019-12-03 01:57:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: 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 the pickerView:didSelectRow:inComponent: ) method. But if the user does not select any value on the picker (coz they want to select the 1st option which is already selected), this method is not called and the selection is not reflected in the variable. I tried setting the default value of the

How to Show UIPickerView when selecting UITextField

匿名 (未验证) 提交于 2019-12-03 01:55:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: 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". 回答1: it will work for you .. i have edited it .and for that you have to set delegate for textfield. and create a UIPIckrView in NIb file. - (BOOL) textFieldShouldBeginEditing:(UITextView *)textView { pickrView.frame = CGRectMake(0, 500, pickrView.frame.size.width, pickrView.frame.size.height); [UIView beginAnimations:nil context:NULL]; [UIView setAnimationDuration:.50]; [UIView

Multiple Row Selection in UIPickerView

匿名 (未验证) 提交于 2019-12-03 01:20:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 由 翻译 强力驱动 问题: I want to select multiple rows in a UIPickerView, so I had the idea to show my data in a table and add this table as subview to the picker. I have tried this but didn't succeed. Any suggestions how to do this? 回答1: the "accepted" UI for multiple selection on the iPhone is to use a UITableView with checkmarks (i.e. don't use UIPickerView for multiple selection). However, if you must, there are instructions on how to fake it here http://www.iphonedevsdk.com/forum/iphone-sdk-development/14634-uipickerview-multiple-selection.html by

UIPickerView in UITableView

匿名 (未验证) 提交于 2019-12-03 01:12:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: 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 with a UIPickerView. In the tableView didSelectRowAtIndexPath method i created the if statement for the right cell -(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{ if (indexPath.row == 1){ } } How can i add a UIPickerView for this cell? It should slide up

Swift does not conform to protocol

匿名 (未验证) 提交于 2019-12-03 01:00:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: After pulling an app that was built using Swift 6 to now a system that is using 6 beta, I'm getting an "EventFormViewController does not conform to protocol UIPickerViewDataSource". I have struggled with this for several days now, any suggestions? import UIKit var eventChoices = [ ["5","10","15","30","45","60","90","120","150","180"], ["Hospital Committee","Peer Review","EHR Improvement","Quality Improvement","Business Development"], ] class EventFormViewController: UIViewController,UIPickerViewDataSource,UIPickerViewDelegate{ @IBOutlet weak

UIPickerView disable row selection

喜你入骨 提交于 2019-12-02 23:39:29
I want to disable the selection of certain rows in my UIPickerView . Like in the Coundown timer, where you try to choose 0, it doesn't let you and slips back up to 1. Or how you can limit the date in the Date Picker ... How do a disable rows in a UIPickerView ? Vladimir In UIPickerView delegate method - (void)pickerView:(UIPickerView *)pickerView didSelectRow:(NSInteger)row inComponent:(NSInteger)component you can check if this selection is valid and scroll to the appropriate row if it is not (using pickerview's - (void)selectRow:(NSInteger)row inComponent:(NSInteger)component animated:(BOOL

UIPickerView selection indicator not visible in iOS10

点点圈 提交于 2019-12-02 23:00:48
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 possible in the XIB, but nothing works. Anyone have an idea on this? This is a custom view which contains a UIPickerView -(void)layoutSubviews{ isShown = NO; [super layoutSubviews]; //self.selectedDic = nil; self.doneBtn.tintColor = COLOR_DB3535; self.pickerView.backgroundColor = COLOR_DEDEDE; self.pickerView.showsSelectionIndicator = YES; [self.doneBtn

Making something happen when something is selected in a UIPickerView

谁说我不能喝 提交于 2019-12-02 22:46:57
问题 I was working on creating an app that uses a UIPickerView. I made the view but I am trying to make a certain button change what it does. Please help. 回答1: UIPickerView and many other controls use delegate pattern to inform you about events happening. To use it add <UIPickerViewDelegate> to your class type definition(@interface line) and after that set the delegate of UIPickerView to your class like this: myUIPickerView.delegate = self; Then you can write the following method in your class and

obj-c : iphone programming : change selection on pickerview programaticaly

我的未来我决定 提交于 2019-12-02 19:34:27
问题 i got a pickerview and i want to add a code that will automaticaly show at the user the row i want. thanks 回答1: Use the -selectRow:… method. [thePickerView selectRow:123 inComponent:0 animated:YES]; 来源: https://stackoverflow.com/questions/2883683/obj-c-iphone-programming-change-selection-on-pickerview-programaticaly

Multiple UIPickerView in the same UIView

余生长醉 提交于 2019-12-02 18:22:06
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 understand how to populate the UIPickerViews with different data. This is the code I have already written: // // ViewController.swift // iphoneVersion // // Created by fselva on 13/05/2015. // Copyright (c) 2015 fselva. All rights reserved. // import UIKit class ViewController: UIViewController, UIPickerViewDelegate{ @IBOutlet weak var pickerView1: