Une astuce pour redimensionner votre UIAlertView ...
Comme Milen Milkovski écrit ci-dessus/ci-dessous, si vous définissez un délégué pour la UIAlertView:
UIAlertView* theAlert = [[UIAlertView alloc] initWithTitle:@"Lah"
message:@"dee dah"
delegate:self
cancelButtonTitle:nil
otherButtonTitles:nil];
//NSLog(@"Pre Show: alert frame x,y: %f,%f, alert frame width,height: %f,%f", theAlert.frame.origin.x,theAlert.frame.origin.y, theAlert.frame.size.width, theAlert.frame.size.height);
[retrievingListAlert show];
Vous pouvez ensuite modifier la cadre de l'UIAlertView en définissant le rappel UIAlertView suivant (dans la classe délégué - dans ce cas, puisque nous avons utilisé self, la même classe que celle où UIAlertView a été créé):
(void)willPresentAlertView:(UIAlertView *)alertView {
//NSLog(@"willPresentAlertView: alert frame midx,midy: %f,%f, alert frame width,height: %f,%f", alertView.frame.origin.x, alertView.frame.origin.y, alertView.frame.size.width, alertView.frame.size.height);
alertView.frame = CGRectMake(x, y, width, heigth);
}
J'ai trouvé que le réglage du cadre à d'autres moments ne fonctionnera pas. Il semble que la fonction show modifie le cadre, vraisemblablement en l'autorisant à son contenu.