Ios 当用户触摸popover外部时,禁用ipad上的操作表
我的应用程序中显示了一个操作表,在iphone上一切正常。然而,在ipad上,它会自动在popover中创建操作表,我无法让它在用户触摸操作表外时禁用Diming 我已经更改了ipad的操作表显示方式,现在使用:Ios 当用户触摸popover外部时,禁用ipad上的操作表,ios,ipad,uiactionsheet,popover,Ios,Ipad,Uiactionsheet,Popover,我的应用程序中显示了一个操作表,在iphone上一切正常。然而,在ipad上,它会自动在popover中创建操作表,我无法让它在用户触摸操作表外时禁用Diming 我已经更改了ipad的操作表显示方式,现在使用: UIActionSheet *actionSheet = [[UIActionSheet alloc] initWithTitle:@"" delegate:self cancelButtonTitle:@"Cancel" destructiveButtonTitle:
UIActionSheet *actionSheet = [[UIActionSheet alloc] initWithTitle:@"" delegate:self cancelButtonTitle:@"Cancel" destructiveButtonTitle:nil otherButtonTitles:@"Choose a preloaded picture", @"Use a photo", nil];
actionSheet.actionSheetStyle = UIActionSheetStyleBlackOpaque;
actionSheet.tag = 1;
[actionSheet showFromRect:CGRectMake(100, 0, 300, 300) inView:self.view animated:YES];
[actionSheet release];
我也试过使用
- (BOOL)popoverControllerShouldDismissPopover:(UIPopoverController *)popoverController
{
return NO;
}
你知道如何阻止用户在操作表外触摸时关闭uiactionsheet popover吗?你的
PopOvercontrollersOuldDismissPopover:
方法不会被调用,因为它是UIPopoverControllerDelegate方法,而你正在处理uiactionsheet。由于UIKit会自动为您创建popover控制器,因此您将没有机会设置其委托。您可以使用[popoverActionsheet superview]
访问popover视图本身,但这不会提供UIPopoverController
从用户体验的角度来看,苹果会要求你不要实施这种行为——如果你需要以模式的方式呈现选项(在用户做出选择之前,选项不会消失),那么用户将更熟悉UIAlertView,或者