uipickerview

How do I decrease the speed in which a row is selected in a PickerView?

随声附和 提交于 2019-12-05 03:58:31
My goal is to create a slotmachine, in which the rows are spinning and one by one, they need to stop spinning, one by one. However, to make it look nice, the rows needs to spin atleast like 3 seconds. I think PickerView is the best option for this, since I have no idea on how to make this work in a different way. When this is my code: self.slotMachine.selectRow(99, inComponent: 1, animated: true) The PickerView will go to row 99, but in 1 second. How can I control this second (and extend the selecting row process)? One condition is it should look nice and feel like you are playing a slot

Bringing up a UIPickerview rather than keyboard input iOS

别说谁变了你拦得住时间么 提交于 2019-12-05 00:43:51
Basically I would like to have the user click in the text field and it bring up a populated pickerview rather than a keyboard. This would also need a toolbar with a done button as well Im presuming. I currently have the field set as an output and action and not much more. I also have an actionsheet in code being used for when the user submits something as well if that makes any difference to possibly using an actionsheet for this as well. I tried researching this topic but 99% of the topics were with datepickers rather than pickerviews (or very old code). Here is an image of what it looks like

Default UIPickerView height

余生长醉 提交于 2019-12-05 00:04:15
How can I programatically obtain the default height of an UIPickerView instance, in accordance to the resolution and orientation of the device that the app is currently running on? I would like not to use a hardcoded value for this parameter, in the event that new devices will support different screen resolutions and thus will determine this component to have a different default size. The warning that André saw doesn't seem to happen anymore (XCode 4.2; iOS SDK 5.0). If you create it with initWithFrame and give it a height of zero, you can then read back it's height from the frame.height

UICollectionView with infinite scrolling?

倖福魔咒の 提交于 2019-12-04 23:26:25
问题 I'm attempting to implement a collection view with an infinite scrolling behaviour. The scrolling should be circular - like in a UIPickerView . Can it be done with Apple's UICollectionView or there is no choice but to create a horizontal PickerView ? What do you think? 回答1: You should watch the WWDC 2011 session video "Advanced ScrollView Techniques", they talk about infinite scrolling, and I'm pretty sure it's possible to use that with UICollectionView s. It recenters while you scroll, and

UIPickerView Inside UITableView Using DateCell

不羁的心 提交于 2019-12-04 20:33:01
I used the amended DateCell code from the following link DateCell without storyboard . I want to replace UIDatePicker with UIPickerView . Below is the code that I have amended/commented to make it work for UIPickerView . On each cell tap, I'm able to show UIPickerView but it only loads once and for the rest of the cells UIPickerView with same row titles appears and it crashes when I select a row from UIPickerView . I'm stuck into this for last couple of days. Any help would be highly appreciated. MoreTableViewController.h #import <UIKit/UIKit.h> @interface MoreTableViewController :

UI Automation Testing: How do I select UIAPickerWheel values?

柔情痞子 提交于 2019-12-04 19:32:57
I've hit a roadblock in trying to write some automated tests for my iPhone app. Judging from the documentation I feel like this should select the first row of the first component of my UIPickerView: var picker = UIATarget.localTarget().frontMostApp().mainWindow().pickers()[0]; var aWheel = picker.wheels()[0]; var someVals = aWheel.values(); aWheel.selectValue(someVals[0]); But instead I get the following error, logged in Instruments: Exception raised while running script: - selectValue requires a valid value Any ideas how I can Set predictable values on my UIPickerView cells/components?

Adding UIPickerView to UIActionSheet (buttons at the bottom)

北战南征 提交于 2019-12-04 17:55:46
I want to show a picker view (sliding up) deactivate the background while it's visible show (UIActionSheet) buttons at the bottom (not at the top) It seems to me an easy solution at first since you can find code for adding a picker view to an action sheet everywhere in the web but all solutions position the buttons at top and I need to put the buttons at the bottom of the action sheet (alignment?) . Is this possible? I guess it is if I look at: Example Regards Jeven EDITED (my solution based on coded dads solution) UIActionSheet *actionSheet = [[UIActionSheet alloc] initWithTitle:nil delegate

UIPickerView reloadData

ぐ巨炮叔叔 提交于 2019-12-04 17:35:46
问题 I'm changing components (in particular, the number and color of components), in a UIPickerView that I call pickerOne, so after making the changes, I call: [pickerOne reloadData]; and it appears to be working perfectly however, I'm getting a compile warning: warning: 'UIPickerView' may not respond to '-reloadData' Although this appears to work, is there something else that I should use to reload data? Thanks 回答1: I think you should be using: reloadComponent: or reloadAllComponents: 回答2: You

UIPickerView - using custom views for multi-line rows - need layout advice

假如想象 提交于 2019-12-04 17:00:58
I have a UIPickerView which will display a list of items for the user. I'd like each item to be presented as multiple lines of text using a different font size for each line. A rough mockup is shown below. This will allow presenting more text than can fit in the single line of the default UIPickerView. bdesham pointed me towards using the pickerView:viewForRow:forComponent:reusingView in the delegate for the UIPickerView. This seems to be the way to go as it'll let me provide my own custom view for the individual rows. My thought was to create a UIView which had 2 UILabel subviews, one for

UIPickerView button selector issue in iOS 7

China☆狼群 提交于 2019-12-04 15:26:31
Having a weird issue of UIPickerView only on iOS 7 I have a UIPickerView which contains 3 rows. Each row has a button whose selector is defined, but it never respond on button tap. Here is my code. - (UIView *)pickerView:(UIPickerView *)pickerView viewForRow:(NSInteger)row forComponent:(NSInteger)component reusingView:(UIView *)view { NSLog(@"row %d", row); if(view == nil) { view = [[[UIView alloc] init] autorelease]; } [view setFrame:CGRectMake(0, 0, 320, 44)]; UIButton *manageButton = (UIButton *)[view viewWithTag:TAG_MANAGE + row]; UILabel *descTypeLabel = (UILabel *) [view viewWithTag:TAG