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
Post a Comment