uipickerview

Reading value from selected row in picker

[亡魂溺海] 提交于 2019-12-11 06:27:23
问题 i have created picker in Xcode with 3 columns, 2. and 3. column are filled with data based on the data in first column. It works fine, and data is displaying correctly, my only problem is how can i write value that is currently displaying ing selected row for 2. and 3. column to some string? Thank you. 回答1: Use - [UIPickerView selectedRowInComponent:] to determine which row is selected, and then return the object at that index within your data array. - (void)pickerView:(UIPickerView *

How to restrict UIPickerView Component

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-11 05:56:47
问题 How to restrict the UIPickerView component scrolling. I have two components in UIPickeView one second component ends scroll allows user to touch the first component to change the value in it. How can I restrict the user to touch component one until and unless the second component scrolling complemented. 回答1: Using this extension, you can check UIPickerView is scrolling or not. Depend on scrolling, you can enable/disable interaction with UIPickerView. extension UIView { func isScrolling () ->

UIPickerView seems to be leaking each time I rotate a component

亡梦爱人 提交于 2019-12-11 05:33:40
问题 UPDATE: Seems to me like it is pretty much an Apple bug. I tried the following: create a new single-window project create a single UIPickerView like the one shown below, only that the picker just allows for turning the dials. That is, neither variables nor any state is manipulated when interacting the picker. RESULT: No matter whether I use the simple titleForRow:forComponent or viewForRow:forComponent, the picker still leaks 48 bytes each time a dial is turned. Further, I even tried having

How to adjust iOS picker wheel to generated random Index

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-11 04:53:25
问题 Using XCode UI Test is there any way we can adjust iOS picker wheel to generated index Value or get the text of index value and adjust the picker wheel. I was able to get the index value using below code. But unable to get the value of the index value. let picker = app.pickerWheels.element(boundBy: 1).otherElements.count print(picker) let randomNumber = arc4random_uniform((UInt32(picker))) print(randomNumber) Using the count of the picker wheel I am generating a random value from that. With

redraw view off screen - contains picker view and tool bar

自作多情 提交于 2019-12-11 04:52:46
问题 Im trying to draw/place a view (which contains a picker view and a toolbar offscreen). On launch the View is still on the screen despite changing its coordinates in viewDidLoad. self.pickerViewContainer.frame = CGRectMake(0, 722, 320, 207); Im using the storyboard. I have created the view in the storyboard, visible in the view controller. I thought i could redraw it off screen as per coordinates above. 回答1: When you use Auto layout write your view's frame related code in viewDidLayoutSubviews

Update table view data based on row component selected in picker view

梦想与她 提交于 2019-12-11 04:33:36
问题 I have an app,where I need to save a reminder in one page and in other display the saved reminder.I have done it successfully using sqlite3 In the view reminder page,the user would have 3 options to view,view all which I have already implemented,view monthly that contains picker view with 12 months,view group I have found out the query for retrieving all the reminders in a particular month,say for month december,I have retrieved using the following query: NSString *sqlQuery = [NSString

Show UIPickerView on label click

☆樱花仙子☆ 提交于 2019-12-11 04:26:31
问题 I use UIPickerView to select data for label: class BookingOptionsViewController: UIViewController, UIPickerViewDelegate, UIPickerViewDataSource { @IBOutlet weak var lblProfile: UILabel! var data = ["1", "2", "3"] var picker = UIPickerView() override func viewDidLoad() { super.viewDidLoad() picker.delegate = self picker.dataSource = self let tap = UITapGestureRecognizer(target: self, action: #selector(tap(gestureReconizer:))) lblProfile.addGestureRecognizer(tap) lblProfile

iOS: Saving a double picker's settings (data persistence)

馋奶兔 提交于 2019-12-11 03:40:01
问题 So I have a double picker where the user sets each wheel to what they want, and then press a button which will display their choice. Easy clean and simple, but I want to store that data for later so that it does not disappear after they close the app and re-open it again. Now, I know how to do it with a datePicker, but not a doublePicker. So my question is how do I tweak my code from saving and retrieving a datePickers info into a doublePicker? Here is my code for the datePicker:

UIdatepicker showing weekdays

房东的猫 提交于 2019-12-11 01:49:13
问题 I would like to make a datepicker that shows weekdays, date and month. I got a working datepicker showing month, date and year but I would really like it to show month, day, date How is this possible? I know I might have to make a custom UIpicker, but how to I make this refer to dates? 回答1: You need to create your own picker with a UIPickerView. Create an NSDateFormatter. You can then access the month names and the weekday names from the date formatter. An NSCalendar can be used to obtain the

UITextfield issue with UIPicker view

假装没事ソ 提交于 2019-12-11 01:44:29
问题 Here is image of view I have following problem. I created a sample user information form for user. He fills some details and submits. See the first sub image in above screenshot. I am entering first name and last name here, normal keyboard will appear when I switch first name to last name manually by scrolling a view or by using keyboard next button on keyboard. Then, when click code textfield, a uipickerview/UIActionsheet will appear. Plase see previous image. It is working fine. When I move