Setting UIAlertView button's color in swift

前端 未结 1 1895
故里飘歌
故里飘歌 2021-01-25 12:51

i\'m a new swift programmer and i need to change the color of my UIAlertView\'s button\'s color. for example i want to change the UIColor of that to yellow. can you help me plea

1条回答
  •  伪装坚强ぢ
    2021-01-25 13:24

    You can change the tintColor like so:

    alert.view.tintColor = UIColor.blackColor()
    

    But customizing a UIAlertView is frowned upon by Apple.

    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.

    UIAlertView Class Reference

    There are alternatives though.

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