uipickerview

How do you shrink a UIPickerView on the iPhone?

妖精的绣舞 提交于 2019-11-26 09:21:33
问题 I would like to reduce the height of a UIPickerView in my iPhone app, so that it shows only one row and one column. The height of the picker view should be equal to the height of a row. I\'m using Interface Builder to construct the UIPickerView , but I can\'t find an easy way to re-size this control. How do you shrink a UIPickerView ? 回答1: Actually, you can slightly shrink the whole UIPickerView by applying an affine transform to an enclosing view. For example: CGSize pickerSize = [pickerView

Fixed labels in the selection bar of a UIPickerView

99封情书 提交于 2019-11-26 08:58:53
问题 In the clocks application, the timer screen shows a picker (probably a UIPicker in UIDatePickerModeCountDownTimer mode) with some text in the selection bar (\"hours\" and \"mins\" in this case). (edit) Note that these labels are fixed : They don\'t move when the picker wheel is rolling. Is there a way to show such fixed labels in the selection bar of a standard UIPickerView component? I did not find any API that would help with that. A suggestion was to add a UILabel as a subview of the

How do you make an UIPickerView component wrap around?

拜拜、爱过 提交于 2019-11-26 06:19:47
问题 I would like to show a set of consecutive numbers in a UIPickerView component but have it wrap around like the seconds component of the Clock->Timer application. The only behavior I can enable looks like the hours component of the Timer application, where you can scroll in only one direction. 回答1: It's just as easy to set the number of rows to a large number, and make it start at a high value, there's little chance that the user will ever scroll the wheel for a very long time -- And even then

UIDatePicker select Month and Year

隐身守侯 提交于 2019-11-26 04:43:53
问题 I need a UIDatePicker for selecting Month and Year only. I checked the class reference documents. Looks like UIDatePicker is a UIView . I imagined UIPickerView may be a sub view and I can hide the component if I can grab it. But no. That was not possible. Do I have to create my own custom picker then? Any ideas? 回答1: Yeah, you probably want to just make your own picker. You don't have to subclass it or anything, though; just use a generic UIPickerView and return appropriate values from your

How to change UIPickerView height

对着背影说爱祢 提交于 2019-11-26 01:46:49
问题 Is it possible to change the height of UIPickerView? Some applications seem to have shorter PickerViews but setting a smaller frame doesn\'t seem to work and the frame is locked in Interface Builder. 回答1: It seems obvious that Apple doesn't particularly invite mucking with the default height of the UIPickerView , but I have found that you can achieve a change in the height of the view by taking complete control and passing a desired frame size at creation time, e.g: smallerPicker = [

Add UIPickerView & a Button in Action sheet - How?

邮差的信 提交于 2019-11-26 00:20:06
问题 My application requires following things to be added in an action sheet. UIToolbar Button on UIToolbar UIPicker Control I have included an image to understand my requirements. Could you please explain, how this can be implemented? 回答1: Update for iOS 7 Apple docs for UIActionSheet: UIActionSheet is not designed to be subclassed, nor should you add views to its hierarchy I recommend against trying to customize the contents of an ActionSheet, as it can lead to serious invalid context errors in

How to change UIPickerView height

北城以北 提交于 2019-11-25 20:47:53
Is it possible to change the height of UIPickerView? Some applications seem to have shorter PickerViews but setting a smaller frame doesn't seem to work and the frame is locked in Interface Builder. danielpunkass It seems obvious that Apple doesn't particularly invite mucking with the default height of the UIPickerView , but I have found that you can achieve a change in the height of the view by taking complete control and passing a desired frame size at creation time, e.g: smallerPicker = [[UIPickerView alloc] initWithFrame:CGRectMake(0.0, 0.0, 320.0, 120.0)]; You will discover that at