导航栏标题过长如何处理?
在我的 iPhone 应用程序中,我的导航栏标题对于页面来说通常太长,导致它们被截断(我通常在标题的两侧各有一个按钮,因此空间有限)。因此,我使用硬编码字体大小创建了自己的标题标签,因此文本会相应缩小。然而,我现在意识到,当选择其他语言时,这不一定看起来正确。
通常的做法是什么?人们是否只是接受截断的标题,或者相应地减小字体大小(对于英语),或者强制使用一个在所有语言中都足够短的非常短的标题?
In my iPhone app, my navigation bar titles were often too long for the page, causing them to truncate (I usually have a button either side of the title, so space is limited). I therefore created my own title labels with a hard-coded font size so the text would shrink accordingly. However, I now realise that this wont neccesarily look right when other languages are chosen.
What is the normal practice for this? Do people just accept a truncated title, or reduce the font size accordingly (for English), or enforce a very short title that will be short enough in all languages?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
我认为这里没有神奇的解决方案。您只需要选择较短的标题或接受截断。如有必要,您始终可以将全文显示在显示中而不是标题栏中。
根据一些用户的反馈,我不会走使用较小文本的路线。 (我将其基于屏幕底部的工具栏而不是标题栏,但同样的原则也适用。)
I don't think there's a magic solution here. You just need to pick shorter titles or accept the truncation. You can always put the full text in the display rather than in the title bar if necessary.
Based on feedback from some users, I wouldn't go down the route of using smaller text. (I'm basing this on a toolbar at the bottom of the screen rather than the title bar, but the same principle applies.)
我选择了一个对于每种语言都足够短的标题,并且无论视图控制器显示什么内容都会显示它。
Apple 将视图控制器显示的内容显示为标题:例如,在 iPod 应用程序中,当您选择播放列表时,会显示整个名称。如果太长,就会被截断。
所以我认为显示一个被截断的标题是可以的。但是,您不应该缩小文本,因为它会变得难以阅读。
I chose one title that is short enough for every language and display it regardless of what the view controller shows.
Apple shows as a title what the view controller shows: in the iPod app, for instance, when you select a playlist, the whole name is displayed. If it is too long, it gets truncated.
So I think it is ok to show a truncated title. You should not however make the text smaller as it will get too hard to read.
我认为用我在我一直使用的一个应用程序中遇到的一个很棒的解决方案来为这次讨论做出贡献是相关的。
https://itunes.apple.com/in /app/bookmyshow-movie-event-play/id405894842?mt=8
这些家伙在标题视图的边界内左右动画标题,如果标题文本太长了。看起来整洁优雅,没有截断、较小的文本或其他麻烦。
Thought it would be relevant to contribute to this discussion with a great solutoin that I came across in one of the apps I've been using.
https://itunes.apple.com/in/app/bookmyshow-movie-event-play/id405894842?mt=8
These guys animate the title left and right within the titleview's bounds, if the title text is too long. Looks neat and elegant without truncation, smaller text or other hassles.