【发布时间】:2017-04-02 20:35:08
【问题描述】:
我使用故事板创建了一个按钮,该按钮被分配了cornerRadius、borderWidth、textAlignment 和clipsToBounds 属性。通过代码,我分配了以下文本以适应按钮的宽度。但是执行的时候不是垂直居中的,也是可视化的。
añadirOtrosCursos.titleLabel?.minimumScaleFactor = 0.5
añadirOtrosCursos.titleLabel?.numberOfLines = 1
añadirOtrosCursos.titleLabel?.adjustsFontSizeToFitWidth = true
añadirOtrosCursos.contentVerticalAlignment = .center
【问题讨论】:
标签: swift button properties