Menu icons are smaller than they should be

SOLVE: I used the icons from sdk v9 (Android 2.3 Gingerbread), which seems to have a different dimension. Asset Studio also creates icons for version 2.3. So I placed the gingerbread icons for drawable-xxpi-v9, and for older versions I put the icons from the SDK v8 to drawable-hdpi, and now it works great

The original subject: Hi, I have a little problem. All the icons in my apk are smaller than the same icons in other applications (Gmail, etc.), this is how it looks in my apk , and this is the same icon in Gmail.apk . I copied these icons directly from the SDK to specific folders for hdpi, mdpi and ldpi.

Here is an example of the hdpi icon I am using and my menu.xml

   <?xml version="1.0" encoding="utf-8"?>
<menu xmlns:android="http://schemas.android.com/apk/res/android">
 <item
  android:id="@+id/refresh"
  android:title="@string/refresh"
  android:icon="@drawable/ic_menu_refresh" />
 <item
  android:id="@+id/add"
  android:title="@string/add"
  android:icon="@drawable/ic_menu_add" />
 <item
  android:id="@+id/login"
  android:title="@string/account"
  android:icon="@drawable/ic_menu_login" />
</menu>

Does anyone know how to make this icon the same size as other apk? I tried asset studio without effect.

UPDATE: If I refer to the icon directly from android (android: drawable), then it has a normal size. However, not all icons can be referenced.

+3
source share
2 answers

I used icons from sdk v9 (Android 2.3 Gingerbread), which seems to have a different size. Asset Studio also creates icons for version 2.3. So I placed the gingerbread icons for drawable-xxpi-v9, and for older versions I put the icons from the SDK v8 in drawable-hdpi, and now it works fine.

0
source

, <supports-screens>.

0

Source: https://habr.com/ru/post/1784116/


All Articles