我alertView
在整个应用程序中添加。我想更改确定或取消按钮的大小, alertView
以便我可以设置动作的小图像。
任何人都请帮助我。
我alertView
在整个应用程序中添加。我想更改确定或取消按钮的大小, alertView
以便我可以设置动作的小图像。
任何人都请帮助我。
You can not change the size of ok
or cancel
button in alertView
.
The only solution that I could figure is to make a custom view with UIVisualEffect
and show it like UIActionSheet
Welcome if other solution is there :)
if you want to do this for adding image, then try following way:
UIAlertController * view= [UIAlertController
alertControllerWithTitle:@"Add Image"
message:@"Image Added successfully"
preferredStyle:UIAlertControllerStyleActionSheet];
UIAlertAction* add = [UIAlertAction
actionWithTitle:@"add"
style:UIAlertActionStyleDefault
handler:^(UIAlertAction * action)
{
//Do some thing here
[view dismissViewControllerAnimated:YES completion:nil];
}];
[add setValue:[[UIImage imageNamed:@"add.png"] imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal] forKey:@"image"];
[view addAction:add];
[self presentViewController:view animated:YES completion:nil];
You cannot change the frame of default Alert view for this you have to use custom alert view. Please refer the below links for custom alert views