UITextField in UIAlertController (border, backgroundColor)

前端 未结 8 1837
陌清茗
陌清茗 2020-12-01 16:38

Here is a screenshot of a UIAlertController. I was just playing around custom fonts and textfield properties but I was unable to accomplish the fol

8条回答
  •  不思量自难忘°
    2020-12-01 17:14

    You can change the border and background color like this:

        let subview = alertController!.view.subviews.first! as UIView
        let alertContentView = subview.subviews.first! as UIView
        alertContentView.backgroundColor = UIColor.lightGrayColor()
        alertContentView.layer.cornerRadius = 10;
        alertContentView.layer.borderWidth = 2;
    

提交回复
热议问题