Android: adjust the position of the action bar overflow popup menu

I have a problem with the action bar overflow popup menu. It is displayed on top of the action bar itself. I want it to appear under the action bar and overflow button. I am using android studio for development.

This is my menu.

<menu xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" tools:context="com.xxx.messageapp.MessageActivity" xmlns:app="http://schemas.android.com/apk/res-auto"> <item android:id="@+id/menu_overflow" android:icon="@drawable/abs__ic_menu_moreoverflow_normal_holo_dark" android:orderInCategory="1" app:showAsAction="always" android:title="@string/action_messages"> <menu> <item android:id="@+id/action_messages" android:title="@string/action_messages" android:orderInCategory="100" app:showAsAction="always" android:icon="@drawable/icon_messages" /> <item android:id="@+id/action_maps" android:title="@string/action_maps" android:orderInCategory="100" app:showAsAction="always" android:icon="@drawable/icon_bus" /> <item android:id="@+id/action_settings" android:title="@string/action_settings" android:orderInCategory="100" app:showAsAction="always" android:icon="@drawable/icon_settings" /> <item android:id="@+id/action_logout" android:title="@string/action_logout" android:orderInCategory="100" app:showAsAction="always" android:icon="@drawable/icon_logout" /> </menu> </item> </menu> 

This is my class

 protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); Intent intent = getIntent(); setContentView(R.layout.activity_message); ActionBar actionBar = getSupportActionBar(); actionBar.setDisplayHomeAsUpEnabled(true); } @Override public boolean onCreateOptionsMenu(Menu menu) { MenuInflater inflater = getMenuInflater(); inflater.inflate(R.menu.menu_message, menu); return super.onCreateOptionsMenu(menu); } 
+5
source share
1 answer

This seems to be a defect in the support library, the error has already been filed: https://code.google.com/p/android-developer-preview/issues/detail?id=1776

Regards, Juan

0
source

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


All Articles