有没有办法用 Swift 设置 UIView 背景颜色?
我知道在 Objective-C 中,您会使用 self.view.backgroundColor = [UIColor redColor];
,但这在 Swift 中的工作方式不同。我环顾四周,因为 Swift 才大约一周大,我找不到答案。
有人有什么建议吗?
最佳答案
self.view.backgroundColor = UIColor.redColor()
在 Swift 3 中:
self.view.backgroundColor = UIColor.red
关于swift - Swift 中的 UIView 背景颜色,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24112272/