您的位置:首页 > 产品设计 > UI/UE

iOS 修改UIAlertController的按钮字体颜色

2016-12-06 18:11 435 查看
      UIAlertController *alert = [UIAlertControlleralertControllerWithTitle:@"确定要删除这个作品吗?"message:nilpreferredStyle:UIAlertControllerStyleAlert];

        

        

       
//修改按钮的颜色

        UIAlertAction *sure = [UIAlertActionactionWithTitle:@"确定"style:UIAlertActionStyleDefaulthandler:^(UIAlertAction
*_Nonnull action) {

         

        }];

        [sure setValue:[UIColorredColor]
forKey:@"_titleTextColor"];

        UIAlertAction *cancle = [UIAlertActionactionWithTitle:@"取消"style:UIAlertActionStyleCancelhandler:^(UIAlertAction
*_Nonnull action) {

            

        }];

        [cancle setValue:[UIColorredColor]
forKey:@"_titleTextColor"];

        [alert addAction:sure];

        [alert addAction:cancle];

        

        [selfpresentViewController:alertanimated:truecompletion:nil];

效果图:

内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息