我有一个关于 UIActionSheet 的简单问题!如何设置 UIActionsheet 的高度?我试过 setFrame 和 setBounds 但没有任何效果。我正在使用以下操作表:
NSString *title = UIDeviceOrientationIsLandscape([UIDevice currentDevice].orientation) ? @"\n\n\n\n\n\n\n\n\n" : @"\n\n\n\n\n\n\n\n\n\n\n\n" ;
UIActionSheet *actionSheet = [[UIActionSheet alloc]
initWithTitle:[NSString stringWithFormat:@"%@%@", title, NSLocalizedString(@"", @"")]
delegate:self cancelButtonTitle:@"Cancel" destructiveButtonTitle:nil otherButtonTitles:@"Button1",@"Button2", nil];
[actionSheet setTag: 1];
//[actionSheet setBounds:CGRectMake(0,0,320,150)];
//[actionSheet showFromRect:CGRectMake(0,0,100,50) inView: self.parentViewController.tabBarController.view animated:YES];
// [actionSheet setFrame:CGRectMake(0, 30, 320, 30)];
actionSheet.actionSheetStyle = UIActionSheetStyleAutomatic;
[actionSheet showInView:self.parentViewController.tabBarController.view];
actionSheet = nil;
我的问题是操作表高度等于当前视图的高度。我想根据 UIActionSheet 的内容自动调整高度。
提前致谢,