alertController with white borders

ぐ巨炮叔叔 提交于 2019-12-05 14:19:36

here is the solution of this white border of UIAlertAction actionSheet

let actionSheet = UIAlertController.init(title: nil, message: nil, preferredStyle: .actionSheet)

if let subview = actionSheet.view.subviews.first, let actionSheet = subview.subviews.first {
    for innerView in actionSheet.subviews {
        innerView.backgroundColor = .purple
        innerView.layer.cornerRadius = 15.0
        innerView.clipsToBounds = true
    }
}

actionSheet.addAction(UIAlertAction.init(title: "Take Photo", style: UIAlertActionStyle.default, handler: { (action) in

}))
actionSheet.addAction(UIAlertAction.init(title: "Choose Photo", style: UIAlertActionStyle.default, handler: { (action) in

}))
actionSheet.addAction(UIAlertAction.init(title: "Cancel", style: UIAlertActionStyle.cancel, handler: { (action) in
}))

actionSheet.view.tintColor = .orange

self.present(actionSheet, animated: true, completion: nil)

Update with hex color

Github : https://github.com/BhaveshDhaduk/AlertControllerSwift

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!