ios - UIAlertController tint color defaults to blue on highlight -
i'm use following code present uialertcontroller action sheet item text red. i've used tint property set color.
uialertcontroller *alertcontroller = [uialertcontroller alertcontrollerwithtitle:nil message:nil preferredstyle:uialertcontrollerstyleactionsheet]; alertcontroller.view.tintcolor = [uicolor redcolor];
the text color seems defaulting blue on highlight or selection. normal , how stop this?
this known bug, see https://openradar.appspot.com/22209332
to fix it, reapply tint color in completion handler. here's swift solution, able adapt objc:
alertcontroller.view.tintcolor = uicolor.redcolor() // apply 1st time prevent flicker blue red when displaying navigationcontroller?.presentviewcontroller(alertcontroller, animated: true, completion: { // bugfix: ios9 - tint not applied without reapplying alertcontroller.view.tintcolor = uicolor.redcolor() })
one note: not fix bug entirely. notice upon device rotation buttons recolored system default (= blue) tint.
expect fixed ios 9.1.
edit 10/23/2015: still not fixed ios 9.1. retested ios 9.1 + xcode 7.1 (7b91b) released couple of days ago. of setting .tintcolor not work, commented can set tintcolor of whole application, e.g. in appdelegate didfinishlaunchingwithoptions set window?.tintcolor = uicolor.redcolor()
. this tints alertcontroller buttons may not suitable in cases tint applied throughout whole application.
Comments
Post a Comment