开发者

Resize UIAlertView

Is there any way I could resize an UIAlertView so it doesn't cover th开发者_StackOverflow社区e tab bar? I tried changing its frame property as it follows but it didn't work.

CGRect alertViewFrame = self.alertView.frame;
alertViewFrame.size.height = alertViewFrame.size.height - kTabBarHeight;
self.localizationDisabledView.frame = localizationDisabledViewFrame;

Thanks!


As far as i am aware, you can't fiddle to much with alert view without getting anybody att apple review group angry but you can try with: https://github.com/TomSwift/TSAlertView

It is nice little replacement for UIAlertView


Here's one solution which I picked up from the web:

UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"My title"
                                                message:@"My message"
                                               delegate:nil
                                      cancelButtonTitle:nil
                                      otherButtonTitles:nil];


alert.transform = CGAffineTransformIdentity;
alert.transform = CGAffineTransformScale( alert.transform, 1.35, 1.35);
[alert show];

Notes: you can set your own values for the button titles, and for the delegate if you wish. When you look at the scaling factors 1.35 and 1.35 (for width and height), the larger the numbers become, the smaller the UIAlertView becomes and vice versa.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜