Change font size for UIAlertView in iOS7

被刻印的时光 ゝ 提交于 2019-12-01 01:55:14

Yes that's correct "The UIAlertView class is intended to be used as-is". You should not access any labels in UIAlertView directly as well as you should not subclass UIAlertView - this is clearly stated by Apple and is likely to lead to a rejection of your App during revision when sent for publication to the Apple Store. The same applies to UIActionSheet.

This explains why you are not given the possibility to access any UILabel via the public API of UIAlertView. Technically you can still access them looking at the content of your UIAlertView subviews NSArray property - that in fact contains all the subviews which include UILabel and UIButton instances. However as mentioned you should absolutely avoid doing this and instead look into implementing your own alert view to be loaded modally when needed.

Like the previous answer states you may be able to access and modify the internal labels but you absolutely 100% should not.

Not sure you will be able to customize this to your needs but you could try looking into this great loading overlay class, MBProgressHUD. But you will probably have better luck with this library (which I've havn't tried) AHAlertView.

A great source to look for iOS libraries is CocoaPods Spec Repo

I won't say you can't, but you shouldn't.

If you really want to do this, I recommend you download this. Then look for the UIAlertView modifications and copy-paste what you need!

I really like the example project in it. Works like a quick reference to what you can do to native ios views.

Hope it helped!

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