简体   繁体   中英

Changing UIDatePicker Size in IOS 6

I'm using UIDatePicker in my app.

In iOS 5 I can change the width and height of the UIDatePicker , however in iOS 6 I cannot. I am using the following code:

CGRect pickerFrame = CGRectMake(0, 90, 100, 100);
datePicker = [[UIDatePicker alloc] initWithFrame:pickerFrame];
datePicker.datePickerMode = UIDatePickerModeDate;

Is there anything extra I have to do for this?

UIDatePicker displays a UIPickerView . Unfortunately, a UIPickerView 's size cannot be changed.

Sure, you could try to trick it by using transforms, but please don't. Not only will it be a headache to you, it'll be harder to use, ugly, fuzzy, and go against human interface guidelines (by making touch targets too small).

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM