朋友我使用了一个简单的操作表,其中包含以下代码: -
popup = [[UIActionSheet alloc] initWithTitle:nil delegate:self cancelButtonTitle:@"Cancel" destructiveButtonTitle:nil otherButtonTitles:
@"Set Calander",
@"New Host",
@"Approvel",
@"Book Session",
@"Alter Session",
@"Update Post",
@"Center View",
@"Log Out",
nil];
[popup showInView:self.view];
答案 0 :(得分:2)
如果设备是ipad而不是showinview
,请使用其他方法,例如tabbar
或barbuttonitem
或rectinview
参考样本代码
-(void)actionPhotoShare:(id)sender
{
actionSheetShare = [[UIActionSheet alloc] initWithTitle:nil
delegate:self
cancelButtonTitle:nil
destructiveButtonTitle:NSLocalizedString(@"ActionSheet_Cancel", @"")
otherButtonTitles:NSLocalizedString(@"ActionSheet_Email", @""),nil];
if (IS_DEVICE_IPAD) {
[actionSheetShare showFromBarButtonItem:sender animated:YES];
}else {
[actionSheetShare showInView:self.view];
}
}