uipickerview

UITextView and UIPickerView with its own UIToolbar

≯℡__Kan透↙ 提交于 2019-11-28 22:33:49
问题 I like to replicate the form behavior of Safari on the iPhone in my own app. If you enter data in an web form you get a separate UIToolbar (previous, next, done) just above the UIKeyboardView. Same for choosing an option: you get the same UIToolbar just above an UIPickerView. I am looking for demos / sourcode / ideas how to implement this. Would I create my own subview with that toolbar and textview / pickerview? Is there a more elegant way? Especially something that leverages

How do I reload/refresh the UIPickerView (with new data array) based on button press?

蓝咒 提交于 2019-11-28 21:53:55
问题 IF I wanted a picker, for states/provinces, i haven't seen an example, but I mocked up shown above, a picker for US/Can/Mex. wondering can you dynamically switch the NSMutableArray for the UIPickerView and then have it somehow reload each time you click on US/Can/Mex buttons??? How do I go about doing this. What approach do I take. Looking for someone to point a beginner for a clue in the right direction. 回答1: You will have to implement the datasource and the delegate. once you press a button

Custom UIPickerView with Custom Background color

巧了我就是萌 提交于 2019-11-28 20:48:52
I have created a sample picker-view which will display some details. Setting the Background color using: _pickerView.backgroundColor = [UIColor redColor]; doesn't seems to be working . But I wish I could create a picker view like the below image What I was trying to do is , the entire PickerView background color should not be white, it should fill with the UIColor which I am giving. Is that possible?? How it can be done ?? Addition to Nina's answer, below are some of the good custom Picker view controls which will be good to use in terms of performance and customizable. http://www

How do I make a UIPickerView in a UIActionSheet

醉酒当歌 提交于 2019-11-28 19:58:34
Just want to know how I would make a UIPickerView in a UIActionSheet with a simple array. Ok well I actually found out how to put it into an action sheet but I like your way better because it applies more to my app, thanks, but I want to also know how put the options into the UIPickerView, I am just hung up on that part of that. I already have an array with the colors: red, green, blue, yellow, black, etc in it but I want to know how to put that into the pickerview if I have already used initwithframe:? Please anyone help I know it is a stupid question but I'm racking my head on my $$$$$$

How do I rewrite the UIDatePicker component?

我只是一个虾纸丫 提交于 2019-11-28 19:35:18
I've noticed that the UIDatePicker doesn't work with NSHebrewCalendar in iOS 5.0 or 5.1. I've decided to try and write my own. I'm confused as to how to populate the data and how to maintain the labels for the dates in a sane and memory efficient manner. How many rows are there actually in each component? When do the rows get "reloaded" with new labels? I'm going to give this a shot, and I'll post as I find out, but please post if you know anything. First off, thanks for filing the bug about UIDatePicker and the Hebrew calendar. :) EDIT Now that iOS 6 has been released, you'll find that

Swift: How to set a default Value of a UIPickerView with three components in Swift?

家住魔仙堡 提交于 2019-11-28 19:12:29
How do I set the starting row of the picker view in Swift? I see there is a code for Objective C, but I don't understand it. If anyone could explain how I can translate the Objective C code into Swift that would also be fantastic ! Thanks mtaylor This is the code I have used in one of my apps: // Declare the outlet to the picker in your storyboard @IBOutlet var myPicker: UIPickerView! //... override func viewDidLoad() { //... myPicker.selectRow(row, inComponent: 0, animated: true) } Obviously, replace row and 0 with whatever values you want. Hope this Helps! @IBOutlet weak var mPicker:

How to change the Font size in UIPickerView?

狂风中的少年 提交于 2019-11-28 16:57:45
I have one UIPickerView. This is having nearly 200 items, each items has long texts, so, i want to resize the UIPickerView's font size. How can i change it? It is possible? Can any one help me? Thanks ! Yuva.M You need to implement pickerView:viewForRow:forComponent:reusingView: method in picker's delegate - (UIView *)pickerView:(UIPickerView *)pickerView viewForRow:(NSInteger)row forComponent:(NSInteger)component reusingView:(UIView *)view{ UILabel* tView = (UILabel*)view; if (!tView){ tView = [[UILabel alloc] init]; // Setup label properties - frame, font, colors etc ... } // Fill the label

iOS Show UIPickerView between UITableViewCells

断了今生、忘了曾经 提交于 2019-11-28 16:22:41
问题 In iOS 7, developers are encouraged to show date pickers between table cells when needed for input, and then hide them when done. How can I achieve this effect? 回答1: Vasilica Costescu has a great tutorial on it here: http://masteringios.com/blog/2013/10/31/ios-7-in-line-uidatepicker/ And for static tables: http://masteringios.com/blog/2013/11/18/ios-7-in-line-uidatepicker-part-2/ Sample code here: https://github.com/costescv/InlineDatePicker The key bits are the hide/show methods: - (void

Customize text color of UIDatePicker for iOS7 (just like Mailbox does)

会有一股神秘感。 提交于 2019-11-28 16:22:22
I'm having the most frustrating dilemma. I've researched up and down and can clearly see that Apple does not want us tampering with iOS 7. Well, I want to tamper. And, the team at Mailbox clearly figured out how to do it and get approved. The main thing that I'm trying to achieve is to change the label color to white. My first thought was they are using a custom UIPickerView that just mimics a UIDatePicker, but I just don't think this is the case. I zoomed in on a small fragment and discovered remnants of a normal UIDatePicker (black lines) along with clipping on the letter "W". Now I've

Elegantly replace iPhone keyboard with UIPickerView

大兔子大兔子 提交于 2019-11-28 16:07:33
I have a table view that has embedded UITextFields for entering some data. It also has two other fields that popup a UIPickerView and a UIDatePicker - as demonstrated in the DateCell example from Apple. Mostly it works but I can't figure out how to cleanly transition from the text field keyboard to the other pickers - one slides out, one slides in - it looks weird and the scroll position on the table view sometimes gets screwed up - with everything scrolled off the top. What I'd like to do is replace the text field keyboard without it animating away and without it growing the table view back