Toolbar's popup menu - custom background (color and borders)

纵然是瞬间 提交于 2019-12-11 14:15:21

问题


How can I make such popup item menu for my toolbar (support v7)?

screenshot of transparent toolbar's popup menu (MX Player)

I found out how to make transparent background:

from layout

  <android.support.v7.widget.Toolbar
      android:id="@+id/toolbar"
      android:layout_width="match_parent"
      android:layout_height="?attr/actionBarSize"
      android:theme="@style/MyToolbarTheme"/>

from style

  <style name="ToolbarTheme" parent="ThemeOverlay.AppCompat.Dark.ActionBar">
    <item name="android:colorBackground">@color/my_transparent_color</item>
  </style>

but how to add borders?

p.s. using shape android:background will cause a lot of shapes everywhere

<item name="android:background">@drawable/background_with_borders</item>

来源:https://stackoverflow.com/questions/50259770/toolbars-popup-menu-custom-background-color-and-borders

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!