ios - 我该如何修复此警告消息。警告 : Ignoring user defined runtime attribute for key path "radius" on instance of "UIButton"

标签 ios swift uibutton storyboard ibdesignable

我收到此警告消息。我该如何解决这个问题。

警告:IB Designables:忽略 UIButton 实例上关键路径 radius 的用户定义运行时属性。尝试设置其值时发生异常:[setValue:forUndefinedKey:]:此类对于键 radius 不符合键值编码。

这是自定义的 UIButtonRounded

@IBDesignable class UIButtonRounded: UIButton
{
    override func layoutSubviews() {
       super.layoutSubviews()
       updateCornerRadius()
    }

    @IBInspectable var rounded: Bool = false {
       didSet {
         updateCornerRadius()
       }
    }

    @IBInspectable var border: Bool = false {
       didSet {
        updateCornerRadius()
       }
    }

    @IBInspectable var radious: CGFloat = 0 {
       didSet {
        updateCornerRadius()
       }
    }

    func updateCornerRadius() {
       layer.cornerRadius = rounded ? radious : 0
       layer.masksToBounds = true
       if(border){
          layer.borderWidth = 1.3
          layer.borderColor = UIColor(named:"color_bg_white")?.cgColor
       }

    }
}

After Appling custom class

Custom class Attribute

Waring msg

提前致谢。

最佳答案

如果您创建一个值并在以后更改它,它仍将存在于身份检查器中用户定义的运行时属性中。去那里删除旧值。

关于ios - 我该如何修复此警告消息。警告 : Ignoring user defined runtime attribute for key path "radius" on instance of "UIButton",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49377734/

相关文章:

ios4 - UINavigationItem BackButtonItem 不显示

iphone - 仪器 .trace 文件问题

ios - IOS 中的 viewDidLoad 与 ViewWillAppear

ios - verifyPhoneNumber 不会在 Firebase 电话身份验证中发送短信

ios - 单词的输入警报自动大写?

ios - UIButton 不会显示标题

ios - 如何使用 Unity 打开 iPhone 设置?

ios - 通用 UITableViewCell 标识符

泛型数组的快速扩展

ios - InterfaceBuilder 中带有多行 titleLabel 的 UIButton