Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/ios/102.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
UIActionsheet Ipad/Iphone_Iphone_Ios_Ipad_Uiactionsheet - Fatal编程技术网

UIActionsheet Ipad/Iphone

UIActionsheet Ipad/Iphone,iphone,ios,ipad,uiactionsheet,Iphone,Ios,Ipad,Uiactionsheet,我目前正在为我的通用应用程序使用UIActionsheet,效果非常好,但我希望iPad的actionsheet类似于iPhone的actionsheet iPad上有没有类似于iPhone操作单的东西?或者,有没有办法在没有方向箭头的情况下重新定位iPad actionsheet和popoverview 谢谢 编辑:下面是我实现和添加操作表的代码 adActionSheet = [[UIActionSheet alloc]initWithTitle:@"Title" delegate:self

我目前正在为我的通用应用程序使用UIActionsheet,效果非常好,但我希望iPad的actionsheet类似于iPhone的actionsheet

iPad上有没有类似于iPhone操作单的东西?或者,有没有办法在没有方向箭头的情况下重新定位iPad actionsheet和popoverview

谢谢

编辑:下面是我实现和添加操作表的代码

adActionSheet = [[UIActionSheet alloc]initWithTitle:@"Title" delegate:self cancelButtonTitle:@"Cancel" destructiveButtonTitle:nil otherButtonTitles:@"Go to Site", @"Some other button", nil];
    [adActionSheet showFromRect:CGRectMake(300, 1150, 200, 200) inView:self.view animated:YES];

实际上,你可以在ipad上从UIPover中删除箭头

[self.popoverController presentPopoverFromBarButtonItem:anItem   
                                permittedArrowDirections:0
                                                animated:YES];


零表示没有方向。

在iPad上,动作表会自动显示在弹出框中。这是无法改变的。您也无法删除该阵列。
UIActionSheet
API不支持您想要的内容


您唯一的解决方案是自定义实现,它可以满足您的需要。

permittedArrowDirection
不应为零。你需要使用这里提到的一个。尝试将其改为
UIPopOverErrorDirectionUnknown
。由于我的操作表自动转换为popover,我是否有权访问popoverViewController选项?我编辑了原始帖子以包含一段代码。在上面的文档链接中:“您不能为此参数指定
UIPopoverArrowDirectionUnknown
。”不要像文档中提到的那样设置为
uipoverarrowdirectionunknown
“您不能为此参数指定uipoverarrowdirectionunknown”。感谢@ZevEisenberg指出这一点。@Steve不,
UIPopoverArrowDirectionUp
被定义为
1UL虽然我希望有一些简单的替代方案,但它也可以。多谢各位
[self.popoverViewController presentPopoverFromRect:rect
 inView:self.view  permittedArrowDirections:0 animated:YES];