Can I move a UIAlertView?
iphone, uialertview
Solution
What OS are you trying this against? I got this to work on both the OS 3.0 Simulator and OS 3.0 Device:
UIAlertView * alert = [ [ UIAlertView alloc ] initWithTitle:@"Alert" message:@"Alert"
delegate:self cancelButtonTitle:@"OK" otherButtonTitles:nil ];
alert.transform = CGAffineTransformTranslate( alert.transform, 0.0, 100.0 );
[ alert show ];
`CGAffineTransformTranslate` takes three arguments: the existing transform, an x transform, and a y transform. In the example I used, the alert view appeared 100 pixels higher than it normally would. Give this a try and see what happens.
Also, I'm pretty certain you can modify the frame before showing the alert as it likely sets up the alert's frame in `init` to be the center of the entire screen by default.
Problem
I've been moving an alert view slightly higher so i can fit a keyboard on screen as well. I just do this by grabbing the frame of the alert and changing the Y after i have already shown the alert so that the frame variables are legit. This works fine on the simulator, but when I do this on the hardware, the alert starts at the correct position but then almost immediately jumps down to it's original vertical center place. Is the UIAlertView position a fixed thing that isn't supposed to change per the usability guidelines or am i just doing something incorrectly? Thanks!