【发布时间】:2019-05-23 16:51:51
【问题描述】:
enter image description hereSo 我有 backgroundView (UIView) 和两个按钮。 现在我制作了以下代码
buttonBackgroundView.layer.cornerRadius = 5.0
buttonBackgroundView.layer.borderColor = UIColor.black.cgColor
buttonBackgroundView.layer.borderWidth = 0.5
@IBOutlet weak var firstbutton: UIButton!{
didSet{
proceedButton.clipsToBounds = true
}
}
在此视图有圆角,但按钮没有圆角 我该如何实施? (所以那个按钮也有圆角。 我有两个按钮,所以我只想要左按钮的左角和右按钮的右角。
我已经添加了我想要实现的图片链接。
【问题讨论】:
-
不是一个明确的问题。请说明。
-
您想将视图屏蔽到边界,而不是按钮。在视图层上试试这个。 developer.apple.com/documentation/quartzcore/calayer/…
-
您需要将父视图的 maskToBounds 设置为 True 而不是按钮。或者您可以正确设置按钮的图层属性和 maskToBounds。
标签: ios iphone uibutton swift4