0

我正在尝试在ActionSheet触摸屏幕时显示scrollview. 操作表在第一页中弹出很好。但在随后的页面上,屏幕变暗并且不显示任何内容,就好像实际按钮显示在屏幕外一样。我已经测试了不同的框架定位,UIActionSheet但它似乎不起作用。

self.view.frame.origin.x似乎有正确的 ScrollView 位置。

UIActionSheet *actionSheet = [[UIActionSheet alloc] 
                                  initWithTitle:nil 
                                  delegate:self 
                                  cancelButtonTitle:@"Cancel"
                                  destructiveButtonTitle:nil 
                                  otherButtonTitles:@"Jump to First Page", @"Browse Pages",nil];

CGRect frame = CGRectMake(self.view.frame.origin.x, self.view.frame.origin.y, 480.0f, 320.0f);  
[actionSheet setFrame:frame];
[actionSheet showInView:self.view];
4

2 回答 2

1

假设您UIScrollView的包含在viewaUIViewController中。

然后,您应该UIActionSheet在视图控制器的根视图中显示它。

于 2010-08-22T03:10:11.853 回答
-1

您在滚动视图中显示它,这是行不通的,因为您是对的,它显示在屏幕外。您不应该在滚动视图中显示它,而是将滚动视图放在另一个视图中并在该视图中显示 ActionSheet。

于 2010-08-21T23:32:52.763 回答