📜  swift uilabel 基于文本长度的动态高度 - Swift 代码示例

📅  最后修改于: 2022-03-11 15:00:59.189000             🧑  作者: Mango

代码示例1
let myLabel = UILabel()
// Set leading and trailing constraints, and either top/bottom constraint,
//   likely done within Storyboard
myLabel.numberOfLines = 0
myLabel.sizeToFit()