简体   繁体   English

如何在UIStackView IOS中向UILabel添加前导填充

[英]How to add leading padding to UILabel in UIStackView IOS

I need your help in adding the leading space only to UIlabel which is placed in UIStackview . 我需要您的帮助, 仅将前置空间添加放置在UIStackview中的UIlabel中 I tried setting constraints but due to UIStackview autolayout feature, it is not allowing me to do. 我尝试设置约束,但是由于UIStackview自动布局功能,它不允许我这样做。 Also, I tried keeping label in UIView but in that case I am not getting the whole lines of label. 另外,我尝试将标签保留在UIView中,但在这种情况下,我没有得到标签的全部内容。

在此处输入图片说明

Does anybody know the solution? 有人知道解决方案吗?

Thanks in Advance. 提前致谢。

You can't do that as Apple documentation says that you can only give position and size to the stack view and the stack view will take care of rest of the things. 正如Apple文档所说的那样,您不能这样做,您只能给堆栈视图指定位置和大小,而堆栈视图将负责其余的工作。

Apple Documentation says: 苹果文档说:

在此处输入图片说明

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM