Android操作栏自定义图标
我想创建像这样的操作栏
我在开发指南中看到操作栏图标应该具有特定大小
是否可以 ?
是否可以在操作栏中添加没有可点击指示的项目?
I want to create Action Bar like this
I saw in Dev guide that Action bar icon should be in specific size
is it possible ?
and also is it possible to add item in action bar with no clickable indication ?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
我理解您对操作栏图标大小的担忧,我也有同样的担忧,直到我发现这个 http://android-ui-utils.googlecode.com/hg/asset-studio/dist/index.html
这是一个可以根据您的需要调整图标大小的工具添加到您的应用程序中,它还提供了一些可供使用的现成剪贴画,您只需单击下载 .zip 即可获得。
享受开发操作栏的乐趣。
i understand your concerns about the action bar icons' size, i had the same, until i discovered this http://android-ui-utils.googlecode.com/hg/asset-studio/dist/index.html
it's a tool which re-size icons for your whatever you want to add to your app, it also provides few ready cliparts that are ready for use, you just have to click download .zip and you'll get it.
Have fun developing your action bar.
//使用您的自定义 xml 视图来显示您的自定义图标
//use your custom xml view to show your customize icons
是的,可以做到。但最好坚持使用推荐的图标尺寸。遵循 UI 指南会大有帮助。
要使左侧图标不可点击,请尝试 setHomeButtonEnabled。由于此 api 仅在 ICS 及更高版本上可用,并且在以前的版本中默认启用图标。因此,您可能有一个不执行任何操作的活动图标。 (好吧,您可以忍受这个限制,因为没有很多 3.x 设备)
自定义视图是您的视图,因此您希望使其可点击或不可点击。要添加自定义视图,
Yes can do it. But it is good to stick to the icon sizes recommended. As working along with UI guidelines go a long way.
To make your left icon no-clickable, try setHomeButtonEnabled. Since this api is available only on ICS and above and in previous versions icon is enabled by default. So you might have an active icon which does nothing. (Well you can live with this limitation as there are not many 3.x devices)
Custom view is your view so its your wish to make it clickable or not. To add custom view,