UIActionView显示错误

时间:2009-10-29 14:32:58

标签: iphone objective-c uiactionsheet

如果有可以同步回Web服务的数据,我的iPhone应用程序中的初始视图加载时会弹出一个UIActionSheet。麻烦的是UIActionSheet弹出太高 - 正好一半的标签栏暴露在操作表下面。我不知道这是造型造成的吗?任何人都可以提供解释/解决方案来防止这种情况发生吗?!

预先感谢您提出任何建议,我的代码会显示在下方......

- (void)viewDidLoad {

    //...preset a few values here, unrelated to the view...
    //...

    // Add an actionsheet to prompt for a DB sync
    if ([myDatabase isSyncPossible] == true) { 
        UIActionSheet *actionsheet = [[UIActionSheet alloc]
            initWithTitle: @"You have information that hasn't been uploaded, would you like to sync now?"
            delegate: self
            cancelButtonTitle: @"No thanks, maybe later"
            destructiveButtonTitle: @"Yes, upload now"
            otherButtonTitles: nil];
        actionsheet.tag = 2;
        [actionsheet showInView:self.view];
        [actionsheet release];
    } 
}

2 个答案:

答案 0 :(得分:2)

对于showInView:来电,请尝试使用导航视图或标签栏视图,而不是控制器的视图。

答案 1 :(得分:0)

假设我理解你的描述,听起来好像'self.view'的框架不会在标签栏下一直运行,而只是中途走。由于操作表从视图的底部绘制,因此它将从该视图的任何位置开始。要修复,请将“self.view.frame”转到屏幕底部。

屏幕截图会有所帮助。

相关问题