UIAlertController
UIAlertController *alertController = [UIAlertController alertControllerWithTitle:@"选择照片" message:nil preferredStyle:UIAlertControllerStyleActionSheet];
UIAlertAction *takePhoto = [UIAlertAction actionWithTitle:@"拍照" style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) {
}];
UIAlertAction *chooseAlbum = [UIAlertAction actionWithTitle:@"相册选择" style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) {
}];
UIAlertAction *cancel = [UIAlertAction actionWithTitle:@"取消" style:UIAlertActionStyleCancel handler:^(UIAlertAction * _Nonnull action) {
}];
[alertController addAction:takePhoto];
[alertController addAction:chooseAlbum];
[alertController addAction:cancel];
NSMutableAttributedString *titleStr = [[NSMutableAttributedString alloc] initWithString:@"选择照片"];
[titleStr addAttribute:NSForegroundColorAttributeName value:[UIColor colorWithHexString:@"#999999"] range:NSMakeRange(0, 4)];
[titleStr addAttribute:NSFontAttributeName value:[UIFont systemFontOfSize:18] range:NSMakeRange(0, 4)];
[alertController setValue:titleStr forKey:@"attributedTitle"];
NSMutableAttributedString *messageStr = [[NSMutableAttributedString alloc] initWithString:@""];
[messageStr addAttribute:NSForegroundColorAttributeName value:[UIColor greenColor] range:NSMakeRange(0, 0)];
[messageStr addAttribute:NSFontAttributeName value:[UIFont systemFontOfSize:20] range:NSMakeRange(0, 0)];
[alertController setValue:messageStr forKey:@"attributedMessage"];
[takePhoto setValue:[UIColor colorWithHexString:@"#EF9707"] forKey:@"titleTextColor"];
[chooseAlbum setValue:[UIColor colorWithHexString:@"#EF9707"] forKey:@"titleTextColor"];
[cancel setValue:[UIColor colorWithHexString:@"#EF9707"] forKey:@"titleTextColor"];
[self presentViewController:alertController animated:YES completion:nil];