向按钮添加标签
我想在 UIToolbar 上标记按钮 (UIBarButtonItem),因为我将使用自定义图标,如果没有它们,这些图标可能不会 100% 明显/直观。很难找出最好的方法来做到这一点。
鉴于按钮在工具栏上垂直居中,实际上没有足够的空间在它们下面放置标签,所以我想知道是否可以将工具栏放在屏幕底部(为我提供标签的空间),然后在其稍上方添加第二个工具栏,与第一个工具栏重叠,我可以在其中添加按钮。 (我假设我可以调整底部栏的颜色,这样它看起来就不那么难看了)。
这样可以吗?一个糟糕的主意?还有其他方法可以实现此目的吗?
(顺便说一句,也与此线程相关:我是如何通过 Interface Builder 得到这个的(它是否“合法”))
I'd like to label the buttons (UIBarButtonItem) on my UIToolbar because I'm going to be using custom icons that may not be 100% obvious/intuitive without them. Having a hard time figuring out the best way to do this.
Given that buttons center themselves vertically on the toolbar there's not really enough space to drop a label below them so I'm wondering if I can get away with putting a toolbar at the bottom of the screen (to give me room for labels) and then adding a second toolbar just slightly above that, overlapping the first, where I can add my buttons. (I'm assuming that I can tweak the colors of the bottom bar so it doesn't look quite as ugly).
Is this okay? A terrible idea? Is there some other way to accomplish this?
(Related, incidentally, to this thread too: How did I get this with Interface Builder (and is it 'legal'))
我不建议你这样做,这可能违背 HIG,而且看起来不会那么好。
如果您的按钮不是太明显,您可以在用户首次打开该屏幕时显示一个弹出窗口,解释哪个按钮的功能。您还可以放置一个小帮助图标来再次显示该弹出窗口。
此外,我认为您可以使用带有文本的按钮而不是图标,但是使用这两种按钮有点违背了图标的目的。
I don't recommend you do that, it's probably against the HIG, and it won't look that great.
If your buttons aren't too obvious, you can display a popover when the user first opens that screen that explains what button does what. You can also put a small help icon that displays that popover again.
Additionally, I think you can use buttons with text instead of an icon, but using both kinda defeats the purpose of the icon.