gpt4 book ai didi

iphone - UILabel Inset 效果可能吗?

转载 作者:行者123 更新时间:2023-12-03 18:40:31 26 4
gpt4 key购买 nike

我给 UILabel 加上边框

Label.text = lbltext;
Label.layer.borderColor = [[UIColor grayColor] CGColor];
Label.layer.borderWidth = 2;

但是文本和边框之间没有空格。
那么如何在标签中设置像 UIButton 这样的插入效果呢?

最佳答案

将标签放入容器 View 中并将边框应用到容器。

关于iphone - UILabel Inset 效果可能吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6854991/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com