如何设置的宽度SIAlertView
?例如,我试过这个,它只设置高度而不是宽度。
SIAlertView *alert = [[SIAlertView alloc] initWithFrame:CGRectMake(20, 20, 240, 100)];
我还尝试在它触发 SIAlertViewWillShowNotification 时设置它,如下所示
- (void)SIAlertViewWillShow:(NSNotification *)notif
{
SIAlertView *alertView = (SIAlertView *)notif.object;
NSLog(@"alert view %@ ", alertView);
CGRect f = alertView.frame;
f.size.width = self.size.width * 0.62;
alertView.frame = f;
[[NSNotificationCenter defaultCenter] removeObserver:self name:SIAlertViewWillShowNotification object:alertView];
}
两者都不起作用,有什么想法吗?