How to display a view as a popup view or like an alert view in iPhone?
I want to display a view with two text field and a button. I want to po开发者_高级运维p the view like an alert view. Just like how Facebook is popping up and asking for credentials.
The UIAlertView will accept addTextFieldWithValue:label:
, but this is an undocumented API and may cause Apple to reject your app. There was a discussion in the iPhoneDevSDK.com forums about this with some sample code to do the same in an acceptable manner.
http://www.iphonedevsdk.com/forum/iphone-sdk-development/1704-uitextfield-inside-uialertview.html
The way to do this is to subclass UIAlertView and override the DrawRect: method. You can then resize the window, change its color, and anything inside. Hope it works out for you!
Edit: here is a link that i used a while back to give me a basic idea behind it. http://joris.kluivers.nl/iphone-dev/?p=CustomAlert
精彩评论