Change font size for UIAlertView in iOS7

后端 未结 2 511
名媛妹妹
名媛妹妹 2021-01-07 14:26

I want to change the font size of message text and title text in alertView. There is no documentation in apple site that speaks about this but apple says \"The UIAlertView c

相关标签:
2条回答
  • 2021-01-07 15:13

    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

    0 讨论(0)
  • 2021-01-07 15:19

    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.

    0 讨论(0)
提交回复
热议问题