在溢出菜单毛刺Android L移动的影子 [英] Android L shadow on overflow menu glitch

查看:206
本文介绍了在溢出菜单毛刺Android L移动的影子的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我移植我申请了新的Andr​​oid L.该应用程序的工作,除了有一个小故障,你从照片中可以看到溢出菜单罚款。

I'm porting my application to the new Android L. The app works fine except for the Overflow menu that have a glitch as you can see from the photos.


任何人都知道如何解决它?
谢谢

Anyone know how to fix it? Thanks

推荐答案

本已定为未来的Andr​​oid版本,但在此期间,你可以通过使用一个透明的弹出式菜单背景解决此问题。在材料中的默认背景是2DP圆角矩形,这将很好地工作,但如果你绝对需要自定义背景,那么你可以这样做:

This has been fixed for a future Android release, but in the meantime you can work around the issue by using a non-opaque popup menu background. The default background in Material is a 2dp rounded rectangle, which will work fine, but if you absolutely need a custom background then you can do something like:

RES /绘制/ my_menu_background.xml:

res/drawable/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>

这篇关于在溢出菜单毛刺Android L移动的影子的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆