UI弹框

1. ios7弹框

// ios7弹框的创建
    // 弹框的创建
    UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"欢迎" message: @"欢迎来到德莱联盟" delegate:nil cancelButtonTitle:@"取消" otherButtonTitles:nil, nil];

    // 显示弹框
    [alert show];

UI弹框_第1张图片


2。ios8弹框

// ios8弹框
    // 创建弹框
    [super viewDidAppear:(BOOL)animated];
    UIAlertController *alert = [UIAlertController alertControllerWithTitle:@"中奖" message:@"恭喜你中奖了" preferredStyle:UIAlertControllerStyleAlert];
    // 添加弹框的取消按钮
    UIAlertAction *action = [UIAlertAction actionWithTitle:@"取消" style:UIAlertActionStyleCancel handler:nil];
    [alert addAction:action];

    // 显示弹框
    [self presentViewController:alert animated:NO completion:nil];}


UI弹框_第2张图片

你可能感兴趣的:(UI)