How to change the background color of the UIAlertController?

前端 未结 10 1451
耶瑟儿~
耶瑟儿~ 2020-11-30 03:49

Due to strange behavior of UIActionSheet in iOS 8, I have implemented UIAlertController with UIAction as buttons in it. I would like to change the entire background of the U

10条回答
  •  Happy的楠姐
    2020-11-30 04:25

    You can use the appearance proxy.

    [[UIView appearanceWhenContainedIn:[UIAlertController class], nil] setBackgroundColor:[UIColor blackColor]];
    

    This seems to apply for all but the cancel action when presenting as an action sheet.

提交回复
热议问题