zoukankan      html  css  js  c++  java
  • ios9 之后,Xcode7不推荐使用UIAlertView,改用UIAlertController+UIAlertAction(按钮)

            /**

             *  ios9 之后,Xcode7不推荐使用UIAlertView,改用UIAlertController+UIAlertAction(按钮)

             */

            UIAlertController *alertCtrl = [UIAlertController alertControllerWithTitle:@"First" message:@"第一次进入app" preferredStyle:UIAlertControllerStyleAlert];

            UIAlertAction *leftAction = [UIAlertAction actionWithTitle:@"确定" style: UIAlertActionStyleDefault handler:nil];

            UIAlertAction *rightAction = [UIAlertAction actionWithTitle:@"取消" style:UIAlertActionStyleDefault handler:nil];

            [alertCtrl addAction:leftAction];

            [alertCtrl addAction:rightAction];

            //当是多个按钮的时候,会变成一列按钮。。。

            [self presentViewController:alertCtrl animated:YES completion:nil];

  • 相关阅读:
    文言文
    【我回来了】TO DO LIST
    AFO
    [DP]
    [CF1221F]Choose a Square
    关于博主(2)
    自我介绍( 并不?
    老年选手的复健之路
    CSP/NOIP 2019 游记
    CSP前模板复习
  • 原文地址:https://www.cnblogs.com/lrr0618/p/5160634.html
Copyright © 2011-2022 走看看