UIActionsheet屏幕

问题描述:

我想显示UIActionSheet在菜单的屏幕中间用下面的代码UIActionsheet屏幕

 
UIView *placeholderview=[[UIView alloc]initWithFrame:CGRectMake(0, 310, 320, 100)]; 
[self.view addSubview:placeholderview]; 
UIActionSheet *actionSheet = [[UIActionSheet alloc] initWithTitle:@"" delegate:self cancelButtonTitle:@"Cancel" destructiveButtonTitle:nil otherButtonTitles:@"Open File",@"Save FIle",@"New File",@"Export Image",nil]; 
[actionSheet showFromRect:CGRectMake(0,0, 320, 10) inView:placeholderview animated:YES]; 
[actionSheet release]; 

我得到所期望,但我可以点击只取消按钮,结果尝试了中间,和一半的出口图像按钮。我不知道我要去哪里错了。请任何机构帮助我。我该怎么做才能使它工作。 enter image description here

+0

什么是你面对的确切问题,PLZ详细说明你的问题是不可理解的 – Gypsa 2011-04-27 09:47:45

+0

可能只是你的placeholderview内可点击的部分?你有没有试图扩大它? – Axel 2011-04-27 09:52:46

+0

我不认为苹果会对此感到满意.. :( – Krishnabhadra 2011-04-27 10:05:15

UIActionSheet被设计为从屏幕的底部呈现。

它提供了在工具栏或选项卡栏中显示这些UI元素可能导致阻塞的方法。

为什么要在屏幕中间显示操作表。我不会推荐这个,因为它看起来不对,而不是控件的设计行为。

您目前使用的方法是用于iPad - 它不应该用于iPhone,因为它会导致未定义的行为(正如您所遇到的那样)。

UIActionSheetshowFromRect:inView:animated:方法只能在iPad上使用。它在iPhone上的行为是未定义的。