作者: 傲骨天成科技 | 来源:发表于2016-01-16 20:09 被阅读41次

    1.初始化警示框
    UIAlertController *alertController=[UIAlertController alertControllerWithTitle:@"友情提示" message:@"你最帅" preferredStyle:UIAlertControllerStyleActionSheet];

    //UIAlertControllerStyleAlert是从中间弹出来,字是黑色的
    //UIAlertControllerStyleActionSheet,底部弹出来,字体是灰色的
    

    2.初始化一个按钮
    UIAlertAction *action=[UIAlertAction actionWithTitle:@"确认" style:UIAlertActionStyleDefault handler:^(UIAlertAction *action) {
    NSLog(@"wo");
    }];
    3.添加按钮
    [alertController addAction:action];

    4.显示警示框
    [self presentViewController:alertController animated:YES completion:nil];

    相关文章

      网友评论

          本文标题:

          本文链接:https://www.haomeiwen.com/subject/hpohkttx.html