Android L shadows on menu overflow crash

I am porting my app to the new Android L. The app works great except for the overflow menu which is crashing as you can see in the photos.

enter image description hereenter image description here

Does anyone know how to fix this? Thanks to

+3


source to share


1 answer


This has been fixed for a future Android version, but for now, you can work around this issue by using an opaque background for the popup menu. The default background in Material is a 2dp square rectangle which will work fine, but if you absolutely need a custom background you can do something like:

Res / draw / my_menu_background.xml:



<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
       android:shape="rectangle">
    <corners android:radius="2dp" />
    <solid android:color="@color/my_color" />
</shape>

      

+2


source







All Articles