Есть ли способ настроить buttons
из uialertcontroller
? Я видел, как настроить шрифт, размер и цвет, но не могу добавить фоновое изображение или цвет кнопки uialertcontroller.
UIAlertController *alertController = [UIAlertController alertControllerWithTitle:nil
message:nil
preferredStyle:UIAlertControllerStyleAlert];
UIViewController *v = [[UIViewController alloc] init];
v.view.backgroundColor = [UIColor cyanColor];
[alertController setValue:v forKey:@"contentViewController"];
UIAlertAction *selectImage = [UIAlertAction
actionWithTitle:@"First Button"
style:UIAlertActionStyleDefault
handler:^(UIAlertAction *action){
NSLog(@"First Button");
}];
[alertController addAction:selectImage];
UIAlertAction *addImage = [UIAlertAction
actionWithTitle:@"Second Button"
style:UIAlertActionStyleDefault
handler:^(UIAlertAction *action) {
NSLog(@"Second Button");
}];
[alertController addAction:addImage];
alertController.view.tintColor = [UIColor redColor];
UIView *subView = alertController.view.subviews.firstObject;
UIView *alertContentView = subView.subviews.firstObject;
[alertContentView setBackgroundColor:[UIColor colorWithPatternImage:[UIImage imageNamed:@"image.png"]]];
alertContentView.layer.cornerRadius = 5;
[self presentViewController:alertController animated:YES completion:nil];
Пожалуйста, предложите, есть ли способ установить фоновое изображение кнопок.
image
ключ здесь[selectImage setValue:image forKey:@"image"]
20.01.2016