ios改变UIAlertController的颜色

-(void)phoneSheetAlet:(NSString *)title msg:(NSString *)msg phoneNumber:(NSString *)phoneNumber
{

    UIAlertController *alertContrller= [UIAlertController alertControllerWithTitle:title message:nil preferredStyle:UIAlertControllerStyleActionSheet] ;
    alertContrller.view.tintColor = kColor(@"#FD5105");//改变alertview的文字颜色

    UIAlertAction *actionConfirm =[UIAlertAction actionWithTitle:[NSString stringWithFormat:@"呼叫 %@",phoneNumber] style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) {
        NSMutableString * str = [[NSMutableString alloc] initWithFormat:@"tel:%@",phoneNumber];
        [[UIApplication sharedApplication] openURL:[NSURL URLWithString:str]];
    }] ;
    UIAlertAction *actionCancel =[UIAlertAction actionWithTitle:@"取消" style:UIAlertActionStyleCancel handler:^(UIAlertAction * _Nonnull action) {

    }] ;
    [alertContrller addAction:actionConfirm] ;
    [alertContrller addAction:actionCancel] ;
    [self presentViewController:alertContrller animated:YES completion:nil] ;
}

暂无评论

相关推荐

获取UIImage的尺寸

int contentWid = self.view.width ; unsigned long width = CGImageGetWidth(image.CGImage) ; unsigned long height …

微信扫一扫,分享到朋友圈

ios改变UIAlertController的颜色