gpt4 book ai didi

ios - 像素完美 UILabel

转载 作者:行者123 更新时间:2023-11-29 12:26:46 24 4
gpt4 key购买 nike

这是两个直接堆叠在一起的标签,它们的背景是彩色的:

enter image description here

我总是先在 Photoshop 中设计我的应用程序。标签顶部和底部的死角使得在设计中精确定位文本变得极其困难。当我想将标签放置在文本的顶部或底部时,如何补偿顶部和底部的空间?

最佳答案

尝试在标签上调用 -sizeToFit 以调整它的大小。

Call this method when you want to resize the current view so that it uses the most appropriate amount of space. Specific UIKit views resize themselves according to their own internal needs. In some cases, if a view does not have a superview, it may size itself to the screen bounds. Thus, if you want a given view to size itself to its parent view, you should add it to the parent view before calling this method.

关于ios - 像素完美 UILabel,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28841250/

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