uipickerview

How can i change Uipickerview position?

戏子无情 提交于 2019-12-11 00:25:48
问题 This is the storyboard I create a picker view like that ; pickerView = UIPickerView() pickerView.center = view.center view.addSubview(pickerView) pickerView.dataSource = self pickerView.delegate = self When i run the app picker view show up like that . But i want the change position pickerview.How can i do that ? 回答1: If you add something programmatically(calling addSubView:) you have to do autolayout programmatically in order to position your view in correct order. There are lots of

UIPickerView selectRow not working as expected

无人久伴 提交于 2019-12-10 22:47:16
问题 I've created a UIPickerView which has two components, the first component (A) has a fixed number of rows set at 13. The other component (B) has a variable number of rows which is dependant on the row selected in (A). When loading the UIPickerView I am calling the following so that I can default the selection in both components, however the issue Im having is that only component (A) shows the correct values. Component (B) doesn't show the correct set of rows or the correct selection. [picker

UIPickerView Set Selected Row by Title

随声附和 提交于 2019-12-10 20:06:18
问题 I'm trying to select a row from code of a UIPickerView that holds a list of locations. The pickerview's content is loaded at runtime from a server, and I have the location the user used when they logged in last. I know I can use [pickerview selectrow:int ...] to select a row by the number, but I need to match the previous location to the location in the picker to get the row number. I haven't been able to find method that helps me do that. If I have been unclear, I am essentially trying to

Search bar at the top of a UIPickerView in Swift

泄露秘密 提交于 2019-12-10 19:23:58
问题 So I have a textField, which when the user presses, it shows a UIPickerView, which is populated from an array. Is it possible for there to be search bar at the top of the pickerView, so the user can search for something in the pickerView? I've not seen this done before so have no idea if it's possible? Thanks in advance. 回答1: UIPickerView is really meant for a few options - if you need to present something that has a lot more options, I would suggest a table view with a search bar. Search Bar

use two UIPickerView in the same class

落爺英雄遲暮 提交于 2019-12-10 17:47:01
问题 I wrote this code for the first UIPickerView - (void)viewDidLoad NSURL *url = [NSURL URLWithString: @"http://localhost:8080/Data/resources/converter.country/"]; ASIHTTPRequest *request = [ASIHTTPRequest requestWithURL:url]; [request setDelegate:self]; [request startAsynchronous]; // countrys = [[UIPickerView alloc] init]; countrys.delegate = self; countrys.dataSource = self; countrys.showsSelectionIndicator = YES; countryField.inputView=countrys; - (NSString*)pickerView:(UIPickerView *

UIPickerView causing crash

烈酒焚心 提交于 2019-12-10 17:26:24
问题 Whenever I try to select the UIPickerView in my App it crashes. I have implemented all the delegate methods but receive this error: 2013-01-15 13:57:56.176 tracker[16142:c07] *** Assertion failure in -[UITableViewRowData rectForRow:inSection:], /SourceCache/UIKit_Sim/UIKit-2372/UITableViewRowData.m:1630 2013-01-15 13:57:56.177 tracker[16142:c07] *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'request for rect at invalid index path (<NSIndexPath

How to set the Voice Over accessibility label for UIPickerView rows?

∥☆過路亽.° 提交于 2019-12-10 16:47:14
问题 I'm trying to make a UIPickerView of mine Voice Over accessible, I've noticed that the UIPickerViewAccessibilityDelegate protocol is rather incomplete. It only allows you to specify labels and hints for pickerView components, not the rows within the components. (it also has a bug that its pickerView:accessibilityLabelForComponent: method doesn't pass a UIPickerView* in it's pickerView parameter, it's a UIAccessibilityPickerComponent instead!) So i'm wondering now, is there any way at all to

How to capture image with AVFoundation framework?

こ雲淡風輕ζ 提交于 2019-12-10 11:47:17
问题 I have following code to open the camera in UIView ,that is working right now. But i have two buttons like in this screen shot one for capturing photo and another one for upload photo from library. How do i capture photo without going to native camera ? Here is my .h file code #import <UIKit/UIKit.h> #import <AVFoundation/AVFoundation.h> @interface bgCameraController : UIViewController<AVCaptureMetadataOutputObjectsDelegate> @property (weak, nonatomic) IBOutlet UIView *cam; @property (strong,

Selecting first row in UIPickerView issue

依然范特西╮ 提交于 2019-12-10 11:25:50
问题 I've a many textfield and a pickerView with toolBar and it has a done button . My issue is I can't select the first row from the picker. While I have debugged in the didSelectRow but it won't run inside it. So please where would be my issue? func pickerView(pickerView: UIPickerView, didSelectRow row: Int, inComponent component: Int) { var value = currentPickerArray[row] textFieldOutletArray[currentTag].text = value } 回答1: Just replace didSelect method in your sample code like as bellowed. it

How to get callback from UIPickerView when the selectRow animation is done?

一个人想着一个人 提交于 2019-12-10 11:18:53
问题 I have a UIPickerView and I would like to be notified when the selectRow animation is done. I tried the following approach in my view controller which has a reference to the UIPickerView and it won't work: -(void)viewDidLoad { ... [UIPickerView setAnimationDelegate:self]; [UIPickerView setAnimationDidStopSelector:@selector(animationFin ished:finished:context]; ... } - (void)animationFinishedNSString *)animationID finishedBOOL)finished contextvoid *)context { if (finished) { } } Then somewhere