UIAlertView text formatting

廉价感情. 提交于 2019-12-12 01:39:58

问题


Hi I was wondering if it is possible to change the text formatting of the uialertview. i.e

The message "You have won" but with the "won" word in bold.

I looked around and it seems that the only solution is for me to create my own popup.

any ideas?

Thanks


回答1:


This isn't possible at present. You'd have to create a custom UIAlertView. That's the only option as it is not to be subclassed.

From the Class Reference:

Subclassing Notes
The UIAlertView class is intended to be used as-is and does not support subclassing. The view hierarchy for this class is private and must not be modified.

There are open source versions out there though. Have a search on "Custom UIAlertView" and you'll easy find them. For example see this question for some links:

Custom UIAlertView?



来源:https://stackoverflow.com/questions/5272326/uialertview-text-formatting

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