iphone - How to change UIAction sheet Cancel button background color -


i trying change background color of uiaction sheet "cancel" button doesn't work. here code snippet

if let subview = alertcontroller.view.subviews.first, let alertcontentview = subview.subviews.first {     innerview in alertcontentview.subviews {         innerview.backgroundcolor =  uicolor.red//stylekit.popoverdefaultbackgroundcolor         //drop shadow         innerview.layer.maskstobounds = false         innerview.layer.shadowopacity = 0.8     } } let subview = alertcontroller.view.subviews.last! uiview let alertcontentview = subview.subviews.last! uiview alertcontentview.backgroundcolor = uicolor.black  let cancelaction = uialertaction(title: "cancel".localize(), style: .cancel)  alertcontroller.addaction(changeaction) alertcontroller.addaction(cancelaction) 

try - let subview = alertcontroller.view.subviews.first! var alertcontentview = subview.subviews.first! alertcontentview.backgroundcolor = uicolor.black alertcontentview.layer.cornerradius = 5


Comments

Popular posts from this blog

php - Vagrant up error - Uncaught Reflection Exception: Class DOMDocument does not exist -

vue.js - Create hooks for automated testing -

Add new key value to json node in java -