【发布时间】:2014-11-12 20:17:39
【问题描述】:
我在代码中创建了一个 UIPickerView,仅当 iOS 8 显示该项目的视图位于顶部时。我怎么把它弄下来?这是使用的代码:
show actionsheet
pickerActionSheet = [self actionSheetSimulationWithPickerView:picker withToolbar:pickerViewToolbar];
// set frames on different orientation
if (UIDeviceOrientationIsLandscape([UIApplication sharedApplication].statusBarOrientation)) {
picker.frame = CGRectMake(0, 32, SCREEN_HEIGHT, 162);
pickerViewToolbar.frame = CGRectMake(0, 0, SCREEN_HEIGHT, 32);
[pickerActionSheet setBounds:CGRectMake(0, 0, SCREEN_HEIGHT, 366)];
}
else{
picker.frame = CGRectMake(0, 44, SCREEN_WIDTH, 216);
pickerViewToolbar.frame = CGRectMake(0, 0, SCREEN_WIDTH, 44);
[pickerActionSheet setBounds:CGRectMake(0, 0, SCREEN_WIDTH, 496)];
}
【问题讨论】: