涟漪棒棒糖打破棉花糖 [英] Ripples break from Lollipop to Marshmallow

查看:134
本文介绍了涟漪棒棒糖打破棉花糖的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一堆有线性布局的项目

I have a bunch of items that have linear layouts with

android:background="@drawable/selector_transparent_semi"

在哪里selector_transparent_semi(值-21)

Where selector_transparent_semi (values-21) is

<ripple xmlns:android="http://schemas.android.com/apk/res/android"
        android:color="?android:colorControlHighlight">
    <item>
        <selector>
            <item android:drawable="@color/semitransparent_color" android:state_enabled="true" android:state_pressed="true"/>
            <item android:drawable="@color/transparent" android:state_enabled="true"/>
        </selector>
    </item>
</ripple>

在一个L器件,半透明的背景将显示在用户pressed当场连锁反应。

On an L device, the semitransparent background would show the ripple effect on the spot the user pressed.

升级到M似乎有重大更改的地方这不再显示出来(大背景下的亮点工作,但没有点和纹波,用户presses)。

After updating to M there appears to be a breaking change where this no longer shows up (overall background highlight works, but no dot and ripple where the user presses).

任何人都知道是怎么回事,如何解决?

Anyone know what's going on here and how to fix it?

编辑:看起来像这样有人M VS L不支持库版本。提单显示不同的涟漪除M一样。更新标题和描述来反映这一点。

Looks like this was M vs L not support lib version. L shows the ripples differently than M does. Updated title and description to reflect this.

推荐答案

出现,改变了涟漪(并购)是在preSS的释放,而不是当你preSS在这也解释了为什么没有不再起作用它做的方式。

Appears that ripples changed (for M) to be on the release of a press instead of when you press in which explains why this no longer works the way it did.

这似乎做我想做的 - 纹波和更改背景,如果你持有它

This seems to do what I want - ripple and change the background if you hold it

<ripple xmlns:android="http://schemas.android.com/apk/res/android"
        android:color="@color/semitransparent_color">
        <item android:id="@android:id/mask"
            android:drawable="@color/semitransparent_color" />
</ripple>

这篇关于涟漪棒棒糖打破棉花糖的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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