【问题标题】:uiscrollview+uiviewcontroller+uiactionsheetuiscrollview+uiviewcontroller+uiactionsheet
【发布时间】:2011-02-15 07:06:21
【问题描述】:

我根据以下教程 Multiple Virtual Pages in a Scrollview 创建了一个应用程序。 我添加了一个按钮,按下时会显示 UIActionSheet。它在第一页上效果很好,但不显示该表的其他页面。我认为这是因为工作表显示在(0,0),所以我尝试使用视图框架初始化工作表。没有运气。

UIActionSheet *actionSheet = [[UIActionSheet alloc] initWithFrame:self.view.frame];
[actionSheet setTitle:NSLocalizedString(@"Create Event", @"Create Event")];
[actionSheet setDelegate:self];
[actionSheet addButtonWithTitle:NSLocalizedString(@"Cancel", @"Cancel")];
[actionSheet addButtonWithTitle:NSLocalizedString(@"Save", @"Save")];
[actionSheet addButtonWithTitle:NSLocalizedString(@"Discard", @"Discard")];
[actionSheet setDestructiveButtonIndex:2];[actionSheet showInView:self.view];
[actionSheet release];

有人知道这里发生了什么吗?我能做些什么来纠正这个问题?

【问题讨论】:

    标签: iphone uiviewcontroller uiscrollview uiactionsheet


    【解决方案1】:

    尝试使用这些函数,而不是自己设置框架

    UIActionSheet *popupQuery = [[UIActionSheet alloc] initWithTitle:无 代表:自己 cancelButtonTitle:@"取消" 破坏性按钮标题:无 otherButtonTitles:@"Ok",nil]

    并使用此功能显示警报

    [popupQuery showInView:self.view];

    祝你好运。

    【讨论】:

    • 我试过这个没有运气。还有其他建议吗?有没有办法让我的视图控制器“知道”它们在 scoll 视图中的位置?
    猜你喜欢
    • 2012-09-27
    • 1970-01-01
    • 1970-01-01
    • 2014-10-05
    • 1970-01-01
    • 1970-01-01
    • 2013-11-01
    • 1970-01-01
    • 2023-03-28
    相关资源
    最近更新 更多