gpt4 book ai didi

ios - UITabBarItem 标签中的多行

转载 作者:行者123 更新时间:2023-11-28 09:35:33 25 4
gpt4 key购买 nike

我已经尝试了很多东西,但无法找到一种方法来放置带有 lineNumber customised.0 的 UITabBarItem 的标签(我想在 2 行上获得标题)。

有办法吗?

最佳答案

现在它包含两个 subview 。在 0 是 imageView,在 1 是标签。现在让 imageview 的高度小一点,这样你就可以给 label 的高度大一点来有多行。通过代码将标签的属性ofnumberoflines设置为0。

let viewTabBar = tabBarItem.value(forKey: "view") as? UIView
let imageView = viewTabBar?.subviews[0] as? UIImageView
let label = viewTabBar?.subviews[1] as? UILabel

现在开始使用这个标签。

关于ios - UITabBarItem 标签中的多行,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46219860/

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