无法查看 swift 上的行
unable to view the line on swift
我正在尝试添加一条从屏幕左侧开始到右侧的水平线。但是这条线是不可见的。
let horizontalLine : CGRect = CGRectMake(45, height-50, 45, 55)
var testView : UIView = UIView(frame: horizontalLine)
self.view.addSubview(testView)
试试这个
let horizontalLine : CGRect = CGRectMake(45, 100-50, 45, 55)
//check value of height. this height>=(status bar height(20)+navigation bar height (44))
var testView : UIView = UIView(frame: horizontalLine)
testView.backgroundColor = UIColor.redColor()
self.view.addSubview(testView)
我正在尝试添加一条从屏幕左侧开始到右侧的水平线。但是这条线是不可见的。
let horizontalLine : CGRect = CGRectMake(45, height-50, 45, 55)
var testView : UIView = UIView(frame: horizontalLine)
self.view.addSubview(testView)
试试这个
let horizontalLine : CGRect = CGRectMake(45, 100-50, 45, 55)
//check value of height. this height>=(status bar height(20)+navigation bar height (44))
var testView : UIView = UIView(frame: horizontalLine)
testView.backgroundColor = UIColor.redColor()
self.view.addSubview(testView)