【问题标题】:Popping a uiactionsheet from uisegmented control button on iPad从 iPad 上的 uisegmented 控制按钮弹出一个 uiactionsheet
【发布时间】:2012-08-27 00:29:57
【问题描述】:

我使用分段控件作为导航。我的分段控件中的一个按钮是“共享”按钮;单击时,希望显示分段控件中的操作表,箭头朝上,朝向分段控件栏。

这没有正确放置操作表弹出框。操作表箭头不是朝上,而是朝下。

感谢您的帮助!

 CGRect screenRect = [[UIScreen mainScreen] bounds];

 CGFloat screenWidth = screenRect.size.width;
 CGFloat screenHeight = screenRect.size.height;

 [self.actionSheet  showFromRect:CGRectMake(190,220,screenWidth,screenHeight) inView:self.view animated:YES];

【问题讨论】:

    标签: ios5 uisegmentedcontrol uiactionsheet


    【解决方案1】:

    iPad 上显示的 UIActionSheet 显示在屏幕中间,没有箭头。你的问题不清楚。

    我相信您实际上正在(或应该)为此目的使用 UIPopoverController。 你能完成你的代码示例吗?

    【讨论】:

    • 谢谢。箭头确实显示在 iPad 操作表对话框上。解决方案在这里找到:stackoverflow.com/questions/3763324/…
    • -showFromRect:inView: 方法的文档指出:在 iPad 上,此方法在弹出框中显示操作表,其箭头指向视图的指定矩形
    【解决方案2】:

    这个问题的解决方案,虽然很老套,但源于弄乱了

    中的参数
    -(void)showFromRect:(CGRect)rect inView (UIView *)view animated:(BOOL)animated 
    

    并通过以下 SO 帖子:

    UIActionSheet Change arrow position?

    【讨论】:

      猜你喜欢
      • 2011-02-07
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2015-01-19
      • 2014-11-08
      相关资源
      最近更新 更多