如何使用RubyMotion设置textField边框颜色?
示例代码:
textField = UITextField.alloc.init
textField.borderStyle = UITextBorderStyleLine
边框颜色显示为Apple的默认颜色。我希望它是红色的。
这是使用RubyMotion,而不是Objective-C
最佳答案
使用Quartz框架。
在您的Rakefile中:
app.frameworks << 'QuartzCore'
设置图层属性:
textField.layer.borderColor = UIColor.redColor.CGColor
textField.layer.borderWidth = 1
textField.layer.masksToBounds = true
关于ios - 如何设置iOS UITextField边框颜色? (RubyMotion + iOS),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25236117/