我是 xcode 的新手,想为 1px 宽的 UIButton 添加黑色轮廓。我在 Xcode 中通过检查器搜索了 UIButton 但找不到设置。我已经阅读了关于 UIButton 的文档,但它似乎没有这个特定的功能。是否可以为 UIButton 添加彩色轮廓?
最佳答案
在 viewDidLoad() 中我输入:
self.buttonName.layer.borderWidth = 1
self.buttonName.layer.borderColor = UIColor.whiteColor().CGColor
关于ios - 如何为 1px 宽的 UIButton 添加黑色轮廓?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38318933/