UITabBarItem 中的标题文本拥抱/字距调整 + 剪辑 [英] Title text hugging/kerning + clipping in UITabBarItem

查看:40
本文介绍了UITabBarItem 中的标题文本拥抱/字距调整 + 剪辑的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个像这样的 UITabBarController:

如您所见,发现"和请求"标题被大量字距调整压缩.它们也在每个项目标题的末尾被略微剪掉.有什么办法可以解决这个问题吗?

附言iPhone 6 和 6+ 不出现此问题,仅 5S 及以下.

解决方案

UITabBars 似乎存在一个问题,如果他们认为自己的框架太小,他们会尝试调整项目标题标签以适应.

这个框架大小的问题可能是由于手动设置 UITabBar 的框架而发生的,也可能是由于项目数量过多而无法适应屏幕(在您的情况下为 5).

根据我对这个问题的经验,有人错误地将 UITabBar 的框架设置为 CGRectZero 以便在隐藏时不会影响布局几何图形界面工具栏.您可能正在手动编辑您拥有的两个标签栏之一的框架吗?

I have a UITabBarController like this:

As you can see, the 'Discover' and 'Requests' titles are compressed by high amounts of kerning. They are also slightly clipped at the end of each item title. Is there any way to fix this?

P.S. The problem does not appear on iPhone 6 and 6+, only 5S and below.

解决方案

It seems like there is an issue with UITabBars where, if they deem their frame too small, they'll attempt to kern the item title labels to fit.

This issue with frame size can happen either from manually setting the frame of the UITabBar or possibly by having a larger number of items than will comfortably fit on screen (in your case 5).

In my experience with this issue, someone had erroneously set the frame of the UITabBar to CGRectZero so that, while hidden, it wouldn't effect layout geometry for a UIToolbar. Might you be manually editing the frame of one of the two tab bars you have?

这篇关于UITabBarItem 中的标题文本拥抱/字距调整 + 剪辑的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆