i have an issue related with UIAlertView . i have created an alert with body message and two buttons for OK and Cancel. when i present the alertWindow , the buttons makes its position outside of the alert window and which is not accessable. it will become normal when orientation changes.
i tried by changing the size of the alertWindow but the problem exists.
here is my code
UIAlertView *errorAlert=[[UIAlertView alloc]initWithTitle:errorAlertTitle message:errorAlertMessage delegate:self cancelButtonTitle:errorAlertClose otherButtonTitles:@"Reload", nil];
errorAlert.tag=2;
errorAlert.frame = CGRectMake(0,0,500,600);
[errorAlert show];
[errorAlert release];
any solution?
When you write "alert window", you mean the visible portion of the UIAlertView
that has text and buttons, right? Do you think that you are setting the frame of the "alert window" in your code? Are you actually setting the frame of a transparent blocking view that prevents the user from interacting with the rest of the UI and contains the "alert window"? The view hierarchy of UIAlertView is private, so we can't know for sure how it is structured, but you may be manipulating the wrong thing. Note that the documentation also warns against interfering with the UIAlertView
view hierarchy, so you may not want to set any view properties like frame for your UIAlertView
.
If you really want to modify the "alert window", you could:
and then
But maybe you want to look into UIActionSheet
or UIPopoverController
if the automatic styling of UIAlertView
is not working for you?