【问题标题】:UIActionSheet position on landscape and portraitUIActionSheet 在横向和纵向上的位置
【发布时间】:2010-03-20 20:22:53
【问题描述】:

当我在横向模式下打开 UIActionSheet 时,它的定位不居中。如果我设置界限或更改框架。作为子视图的 UIActionSheet 中的内容发生了变化,但实际工作表仍然在同一个地方,看起来很尴尬。

如何将 UIActionSheet 及其子视图移动到屏幕中心?

【问题讨论】:

  • 我最终使用 UIAlertView 将我的内容作为子视图添加到警报视图。

标签: cocoa-touch uikit ipad orientation uiactionsheet


【解决方案1】:

您可以使用以下代码,以便您可以根据需要将他的 UIActionsheet 放在屏幕中间。

        UIActionSheet *actionsheet1 = [[UIActionSheet alloc]initWithTitle:@"Options" delegate:self cancelButtonTitle:@"Cancel" destructiveButtonTitle:nil otherButtonTitles:@"Contacts", @"Employees",nil];
        actionsheet1.tag = 1;
        [actionsheet1 showInView:self.view];
        [actionsheet1 setActionSheetStyle:UIActionSheetStyleBlackOpaque];
        [actionsheet1 release]; 

请检查此代码,如果您仍有任何问题,请告诉我。

【讨论】:

    猜你喜欢
    • 2014-06-03
    • 2012-01-12
    • 2012-03-29
    • 2015-09-09
    • 1970-01-01
    • 2015-12-31
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多