开发者

How to display a view as a popup view or like an alert view in iPhone?

开发者 https://www.devze.com 2023-01-06 16:42 出处:网络
I want to display a viewwith 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

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

0

精彩评论

暂无评论...
验证码 换一张
取 消