0

I want to have a different size for my data picker frame. How can I create this with an Array?

Here is my code:

if(UIInterfaceOrientationIsLandscape([self.delegateVCtr interfaceOrientation])){
    //I want to have different int here for changing size 
    self.viewOfPicker.frame=CGRectMake(0, 0, 480, 230);
    self.pkrView.frame=CGRectMake(0, 44, 480, 216);
    self.tBar.frame=CGRectMake(0, 0, 480, 33);
} else {
    self.viewOfPicker.frame=CGRectMake(0, 0, 320, 230);
    self.pkrView.frame=CGRectMake(90, 28, 160, 216);
    self.tBar.frame=CGRectMake(0, 0, 320, 33);
}

- (NSInteger)sizeOfComponentsInPickerView:(UIPickerView *)pickerView {
return sizeOfComponents;
}
Usama Abdulrehman
  • 1,041
  • 3
  • 11
  • 21

1 Answers1

0

AFAIK you can use CGRectZero as a frame because the UIDatePicker won't resize itself. Also take into consideration that this is because of a reason: Apple says if it's any smaller than the default size it will affect its usability and in the end it won't be accepted in the store. You unfortunately have to mod your design. Otherwise @Randeep's second answer is the easiest way.

Hope that helps!

Cheers!

Zoltan Varadi
  • 2,468
  • 2
  • 34
  • 51