Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/angularjs/25.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ios NSAttributedString的UILabel对齐_Ios_Swift_Uikit - Fatal编程技术网

Ios NSAttributedString的UILabel对齐

Ios NSAttributedString的UILabel对齐,ios,swift,uikit,Ios,Swift,Uikit,如何将UILabel属性化文本垂直对齐并水平向左对齐? 谢谢 垂直和水平居中文本:我的设计师不喜欢后者您只需将对齐属性设置为.leftUILabel默认情况下,文本垂直居中: let style = NSMutableParagraphStyle() style.alignment = .left let style = NSMutableParagraphStyle() style.alignment = .left

如何将UILabel属性化文本垂直对齐并水平向左对齐? 谢谢


垂直和水平居中文本:我的设计师不喜欢后者

您只需将
对齐
属性设置为
.left
<代码>UILabel默认情况下,文本垂直居中:

let style = NSMutableParagraphStyle()
style.alignment = .left
let style = NSMutableParagraphStyle()
style.alignment = .left