Is there any way to change the frame of the UIAlertView in iPhone or iPad. I tried changing the frame in the following delegate method- (void)willPresentAlertView:(UIAlertView *)alertView;
but even then the width of the Alertview remained unchanged. And I think a small Alertview in iPad will not make sense. And I guess there must be a way to achieve it, at least in iPad.
Thanks, krishnan.
Hmm, this code works fine (except, when you are trying to decrease size - cause in this case you can get some bad rendering):
- (void)willPresentAlertView:(UIAlertView *)alertView {
alertView.frame = CGRectMake(x, y, width, height);
}
Maybe, you forgot to set UIAlertView
's delegate with something like someAlertView.delegate = self;
UPDATE ↓
codepart:
- (IBAction)go:(id)sender {
UIAlertView *alert = [[[UIAlertView alloc] initWithTitle:@"Title" message:@"Message" delegate:self cancelButtonTitle:nil
otherButtonTitles:nil] autorelease];
alert.delegate = self;
[alert show];
}
- (void)willPresentAlertView:(UIAlertView *)alertView {
alertView.frame = CGRectMake(5.f, 1.f, 100.f, 200.f);
}
Result (on my iPod): http://dl.dropbox.com/u/6455784/alert_view_frame.png
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With