如何使用RubyMotion设置文本框的边框颜色?
示例代码:
textField = UITextField.alloc.init
textField.borderStyle = UITextBorderStyleLine
边框颜色显示为苹果默认的颜色; 我希望它是红色的。
这是使用RubyMotion,而不是Objective-C的
如何使用RubyMotion设置文本框的边框颜色?
示例代码:
textField = UITextField.alloc.init
textField.borderStyle = UITextBorderStyleLine
边框颜色显示为苹果默认的颜色; 我希望它是红色的。
这是使用RubyMotion,而不是Objective-C的
使用Quartz框架。
在你的Rakefile:
app.frameworks << 'QuartzCore'
要设置层属性:
textField.layer.borderColor = UIColor.redColor.CGColor
textField.layer.borderWidth = 1
textField.layer.masksToBounds = true