0

我想为我的数据选择器框架设置不同的大小。如何使用数组创建它?

这是我的代码:

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;
}
4

1 回答 1

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!

于 2012-08-27T09:54:13.150 回答