我试图将UILabel
文字放在视图的底部,但是我还没有能够摆脱它。
这是我迄今为止所尝试过的:
@IBOutlet weak var securityCodeLabel: UILabel! {
didSet {
// This also didn't work
//securityCodeLabel.layoutMargins = UIEdgeInsetsMake(securityCodeLabel.layoutMargins.top, securityCodeLabel.layoutMargins.left, 0, securityCodeLabel.layoutMargins.right)
securityCodeLabel.frame = CGRectMake(securityCodeLabel.frame.origin.x, securityCodeLabel.frame.origin.y, securityCodeLabel.frame.size.width, (securityCodeLabel.frame.size.height - securityCodeLabel.font.descender))
}
}
我之后的影响:
正如您所见,文本位于视图底部。