【问题标题】:Option buttons modal view ios7选项按钮模式视图ios7
【发布时间】:2014-02-28 21:24:04
【问题描述】:

我的目标是重新创建 Facebook Messenger 和许多其他应用在显示选项时使用的选项视图。

执行此操作的最佳方法是什么?是否有内置类可以让我这样做?是否有优秀的第三方应用可以完成这项任务?

【问题讨论】:

    标签: ios7 uibutton modalviewcontroller


    【解决方案1】:

    因此,在进行了一些挖掘之后,您需要的是一份行动表。操作表非常简单,可以设置操作表:

    UIActionSheet *actionSheet = [[UIActionSheet alloc] initWithTitle:nil
                                                         delegate:self
                                                cancelButtonTitle:@"Cancel"
                                           destructiveButtonTitle:@"Delete Note"
                                                otherButtonTitles:nil];
    

    收集响应

    - (void)actionSheet:(UIActionSheet *)actionSheet clickedButtonAtIndex:(NSInteger)buttonIndex{
        NSLog(@"The %@ button was tapped.", [actionSheet buttonTitleAtIndex:buttonIndex]);
    }
    

    更多信息:https://developer.apple.com/library/ios/documentation/userexperience/conceptual/UIKitUICatalog/UIActionSheet.html#//apple_ref/doc/uid/TP40012857-UIActionSheet

    额外:

    这是一个开源模态框架:https://github.com/reednj/TDSemiModal

    【讨论】:

      猜你喜欢
      • 2013-11-27
      • 1970-01-01
      • 2014-07-31
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2014-04-17
      • 2016-11-09
      • 2016-03-31
      相关资源
      最近更新 更多