Can I customise the UIAlertView [iPhone iOs 4]?

这一生的挚爱 提交于 2019-12-08 04:48:20

问题


I try to run this a sample that customise UIAlertView but it doesn't work.

http://joris.kluivers.nl/iphone-dev/?p=CustomAlert

I would like to change the background image of the UIAlertView.

Can I do it?

Thanks


回答1:


I have customized UIAlertView before, which broke when a new OS was released (4.2, specifically). I recommend implementing your own custom view instead of trying to customizing UIAlertView.




回答2:


Technically yes, you can, but it's frowned upon. Modifying the private view hierarchy of a framework-provided control is dangerous and can cause incompatibility with future versions of the OS. What's more, you're breaking UI conventions if you start changing these things, and that should not be done lightly.




回答3:


I have a UIAlertView replacement, shared on on github, that supports using a custom background:

https://github.com/TomSwift/TSAlertView



来源:https://stackoverflow.com/questions/4798271/can-i-customise-the-uialertview-iphone-ios-4

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!