简体   繁体   English

ActionBar图标有不同的大小

[英]ActionBar Icons having different sizes

In my android application, some of the action bar icons are at normal size (like the star in the screenshot) and some are too small (like the browser and the share icon in the screenshot). 在我的Android应用程序中,一些操作栏图标处于正常大小(如屏幕截图中的星号),有些图标太小(如屏幕截图中的浏览器和共享图标)。

截图

All of the Icons are added in the exact same way: 所有图标都以完全相同的方式添加:

menu.add(getString(R.string.sync)).setIcon(R.drawable.ic_action_sync)

This happens in three of my activities with different icons. 这发生在我的三个具有不同图标的活动中。 The image files are in the correct directories for their density, they are all from the ActionBar Icon Pack and do all look the same size in the directory on the computer. 图像文件的密度位于正确的目录中,它们都来自ActionBar Icon Pack,并且在计算机上的目录中看起来都相同。

I use ActionBarSherlock to display the Actionbar on Gingerbread, but it looks exactly the same on ICS/JB, where ActionBarSherlock should use the native ActionBar (so I guess it's not ABSherlock's fault). 我使用ActionBarSherlock在Gingerbread上显示Actionbar,但它在ICS / JB上看起来完全一样,ActionBarSherlock应该使用本机ActionBar(所以我猜它不是ABSherlock的错)。

I have no idea, what the reason of this could be. 我不知道,这可能是什么原因。

It looks like your icon drawable resources are not the correct size. 看起来您的图标可绘制资源的大小不正确。 To fix this, you will need to recreate your icons. 要解决此问题,您需要重新创建图标。

When you do this, be sure to check the Android Design- Iconography page to ensure that you are creating your resources at the right resolution. 执行此操作时,请务必查看Android Design- Iconography页面,以确保以正确的分辨率创建资源。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM