Alertview code:
UIAlertView *customAlert = [[UIAlertView alloc]initWithTitle:@"hi" message:nil delegate:self cancelButtonTitle:@"OK" otherButtonTitles:nil, nil];
[customAlert show];
You can't customise UIAlertView
for example, resize, change font attributes etc, because Apple doesn't allow anyone to change its UI controls.
One solution is to check the subviews of UIAlertView
and changing frame of your alert but it's against Apple's NDA and your app will probably get rejected by Apple and there will be no guaranty of solution to work in different iOS
versions.
Other solutions is to create your own custom alert using UIView
, UILabel
and UIButton
objects. But it's not recommended as it's highly unlikely that you'll provide complete functionality, controls and features provided by UIAlertView
.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.