1

I've set up a simple menu with one position like this:

<?xml version="1.0" encoding="utf-8"?>
<menu xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools" tools:context=".MainActivity">

<item android:id="@+id/action_language" android:title="@string/language"
    android:orderInCategory="100" />
</menu>

using

Theme.AppCompat.Light.DarkActionBar

style. When I click the three dots the menu position appears instead of the icon, not below it? Is there any way to make it appear under the icon, not 'on' it?

1 Answers1

1

Actually you can't do anything with this icon, but you can create menu item with android:actionLayout="@layout/custom_lauout". Then you can create Popup Window, which allows such positioning. In popupWindow you will show all items that must show under "three dots item".

Here rea a few links which can help you: http://developer.android.com/reference/android/widget/PopupWindow.html https://stackoverflow.com/a/23516493/3864698

Community
  • 1
  • 1
QArea
  • 4,955
  • 1
  • 12
  • 22
  • So it's default behavior and apps like gmail/hangouts are using popupmenu to get around this? –  Nov 10 '14 at 13:21
  • @terrifish These apps don't use popup menu. They use default menu item. But in your case you need to replace menu (I think position depends on device by default). If you want to change only icon, see this: http://stackoverflow.com/a/9733538/3864698 But as I understand you need to replace. Sorry, if I misunderstood. – QArea Nov 11 '14 at 15:06