如何添加图标,玻璃的选择菜单项? [英] how to add icon to glass options menu item?

查看:125
本文介绍了如何添加图标,玻璃的选择菜单项?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想,而在一个特定的浸泡,以创建一个选项菜单。我如何定义旁边的菜单项标题的图标?

I want to create an options menu while in a specific immersion. How can I define an icon next to the menu item title?

我知道,从时间线上打开我的应用程序时,我的应用程序图标显示为默认值相关的菜单项旁边,但现在我想要做的菜单一样我的应用程序中。

I know when opening my app from the timeLine, my app icon is shown be default next to the relevant menu item, but now i want to do the same in a menu inside my app.

(我用的是谷歌眼镜GDK)。

(I am using the Google Glass GDK.)

推荐答案

您可以这样做同样的方式,你会在Android上,在你的菜单项的 Android的指定资源:图标属性。例如,

You can do this the same way that you would on Android, by specifying a resource in your menu item's android:icon attribute. For example,

<item android:id="@+id/foo" android:icon="@drawable/my_icon" />

将查找一个名为图标 RES /绘 - * / my_icon.png

要匹配推荐玻璃UX /设计指南,你的图标应该是白色的透明背景和50倍; 50像素。

To match the recommended Glass UX/design guidelines, your icon should be white with a transparent background and 50 × 50 pixels.

这篇关于如何添加图标,玻璃的选择菜单项?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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