How to add padding to an UILabel? [duplicate]

我怕爱的太早我们不能终老 提交于 2020-01-24 02:40:47

问题


The text inside an UILabel is smashed against the left and right borders. Is there an way of adding some inner padding to the UILabel, so that text won't touch the inner borders so closely?


回答1:


Just adjust the position of the label (I'm not aware of any other method, although someone else might). If you have an issue with background colors (for instance), make the background a separate UIView and put the label on top of it.



来源:https://stackoverflow.com/questions/2702259/how-to-add-padding-to-an-uilabel

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!