Why are options menu items compressed if I use support library 26?

The options menu items were the size they should have been in the support library 25, but when I use 26.0.0 they are all compressed.

xml menu item

<?xml version="1.0" encoding="utf-8"?> <menu xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto"> <item android:id="@+id/people" android:icon="@drawable/icon_addfriends_newsfeed" android:title="" app:showAsAction="always" /> </menu> 

onCreateOptionsMenu in AppCompatActivity

 @Override public boolean onCreateOptionsMenu(Menu menu) { getMenuInflater().inflate(R.menu.newsfeed, menu); return true; } 

toolbar layout

 <android.support.design.widget.AppBarLayout android:layout_width="match_parent" android:layout_height="wrap_content" android:orientation="vertical" android:theme="@style/AppTheme.AppBarOverlay"> <android.support.v7.widget.Toolbar android:id="@+id/toolbar" android:layout_width="match_parent" android:layout_height="?attr/actionBarSize" android:background="?attr/colorPrimaryDark" android:theme="@style/ToolbarColoredBackArrow" app:popupTheme="@style/AppTheme.PopupOverlay"/> </android.support.design.widget.AppBarLayout> 

25

26.0.0

+5
source share
1 answer

There were no icons in the project for different screen sizes. So, I created the icons with Android Asset Studio for different screen sizes. I selected the โ€œAction / Tab Icon Generatorโ€ in Android Asset Studio when I did this. I am adding these icons to the project. I cleaned up the project and compiled it. Finally, it has been fixed.

+3
source

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


All Articles