I had a UIAlertView window which worked fine in iPhone OS 3.1.3, with SDK 3.1.3 and XCode 3.2.1.
But after I updated the iPhone to OS 4.0 by iTunes, consequently had to upgrade the SDK to 4.0 (with XCode 3.2.3), the UIAlertView window turns out too high when popping up, and only drops down to the correct position after the textField is tapped with the keyboard pops out.
But you are using the UIAlertView differently than Apple "recommends".
You added UITextFields, and therefore had to move the alert view yourself with the transform. I do this in my app.
Well, the reason why apple says, use the public apis, and as we recommend you using them, is because they give no guarantee that what you wrote will work in newer versions. And here is an example of such a case.
I recommend the transform code be put into an if statement, where you check what version the OS is, if it is below 4.0 do the transform. If it isn't then don't.
I am not sure, but the Alert's 'jump' is likely related to the OS overridding your overrided UIAlertView's location on the screen... but it may be related to your transform.
Using the AlertView this way will not be refused by Apple, I believe, though maybe not "recommended". But anybody has a better way of getting a popped window out to pick some text inputted by user? Please provide suggestions.
I found out the problem and solution: the AlertView window only comes out too high when the "Base SDK" is set to "Simulator/Device 4.0", no matter what you set in "iPhone OS Deployment Target". After I use "Simulator/Device 3.2" for "Base SDK", the AlertView window works fine.
However, this is a BIG however, the XCode 3.2.3 comes with SDK 4.0, which is the only choice for building for iPhone OS4, does not provide the right iPhone Simulator! If you pick "Simulator 3.2", it always comes out the iPad Simulator, and your iPhone app does not simulate there properly. If you pick "Simulator 4.0", though the UI looks like a iPhone, but functions are still not responding, e.g. tables cannot roll, maps cannot move, etc.
No other SDK options in XCode 3.2.3.
In the end, I installed the previous XCode 3.2.1 with SDK 3.1.3 into another directory, to Simulate with SDK 3.1.3, and build into the iPhone OS4 with the XCode 3.2.3 from SDK 4.
It is the affine transform indeed, just remove it or adjust the correct value to shift up conditionally when device uses OS4. And you cannot avoid using Base SDK 4.0 , it is the only proper way to support fast app switching, and I believe Apple will not allow anything built below it.