iOS 中使用xib创建的控件边框和颜色等设置

网上有很多,这里只是记录一下方便自己将来忘记的时候查找,如果想要查看更全的还是看看其他人书写的比较好



设置圆角需要到的Key Path:

  • layer.cornerRadius ,注意该 key 对应 Value 的 type 应该设置为 String  数值自己根据要求设置
  • layer.masksToBounds ,注意该 key 对应 Value 的 type 应该设置为 Boolean , 当右侧出现对号时为YES
  • 设置边框需要到的Key Path:
    • layer.borderWidth ,注意该 key 对应 Value 的 type 应该设置为 String
    • layer.borderColor , 注意该 key 对应 Value 的 type 应该设置为 Color




猜你喜欢

转载自blog.csdn.net/nopolun_ios/article/details/68922244