//设置文本字体对齐方式,对齐属性有以下几种,默认是左对齐 // Left : Visually left aligned // Center : Visually centered // Right : Visually right aligned // Justified : Fully-justified. The last line in a paragraph is natural-aligned. // Natural : Indicates the default alignment for script nameLabel.textAlignment = .right
//设置换号模式,换行模式有以下几种,默认是ByWordWrapping // ByWordWrapping /* What to do with long lines */ /* Wrap at word boundaries, default */ // ByCharWrapping /* Wrap at character boundaries */ // ByClipping /* Simply clip */ // ByTruncatingHead /* Truncate at head of line: "...wxyz" */ // ByTruncatingTail /* Truncate at tail of line: "abcd..." */ // ByTruncatingMiddle /* Truncate middle of line: "ab...yz" */ //设置折行方式 nameLabel.lineBreakMode = .byTruncatingHead