actionlayout on menuitem does nothing

后端 未结 4 975
情书的邮戳
情书的邮戳 2020-11-30 03:09

i am setting an actionLayout on a menu item and setting background color and image, but it\'s not respected. in my activity, i have:

getMenuInflater().inflat         


        
4条回答
  •  时光说笑
    2020-11-30 03:22

    Try app:actionLayout="@layout/check" instead of android:actionLayout="@layout/check".

    If you're using ActionbarSherlock or AppCompat, the android: namespace will not work for MenuItems. This is because these libraries use custom attributes that mimic the Android APIs since they did not exist in earlier versions of the framework.

提交回复
热议问题