Muddu Patil
Muddu Patil

Reputation: 721

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?

Upvotes: 0

Views: 1516

Answers (1)

fzwo
fzwo

Reputation: 9902

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).

Upvotes: 1

Related Questions