zoukankan      html  css  js  c++  java
  • Navigation Drawer中RecyclerLayout中item点击无Drop Animation的问题

    在style或自定义theme(v21)中添加如下:

            <item name="android:colorControlHighlight">#20000000</item>

    并在item_roll.xml中加入:

    android:clickable="true"
    android:background="?attr/selectableItemBackground"

    问题产生原因:

    “It turns out this is working as intended. The standard Material theme colorControlHighlight value is #40ffffff. So on a white background, this will not show up. Changing the highlight color to something else works, and/or changing the background color of the object.

                             ————————stackoverflow

    也就是说Material Theme的colorcontrolHighlight默认值是#40ffffff。在白色背景下动画效果并不会显现。解决方法是将背景颜色改变,或者更改Hightlight color。

    AppCompat tinting attributs:

    First, you should take a look to appCompat lib article there and to different attributs you can set:

    colorPrimary: The primary branding color for the app. By default, this is the color applied to the action bar background.

    colorPrimaryDark: Dark variant of the primary branding color. By default, this is the color applied to the status bar (via statusBarColor) and navigation bar (via navigationBarColor).

    colorAccent: Bright complement to the primary branding color. By default, this is the color applied to framework controls (via colorControlActivated).

    colorControlNormal: The color applied to framework controls in their normal state.

    colorControlActivated: The color applied to framework controls in their activated (ex. checked, switch on) state.

    colorControlHighlight: The color applied to framework control highlights (ex. ripples, list selectors).

    colorButtonNormal: The color applied to framework buttons in their normal state.

    colorSwitchThumbNormal: The color applied to framework switch thumbs in their normal state. (switch off)

  • 相关阅读:
    第二阶段冲刺之站立会议5
    第二阶段冲刺之站立会议4
    第二阶段冲刺之站立会议3
    “加减乘除”使用说明
    第二阶段冲刺之站立会议2
    Kali学得好,监狱蹲到老,最新版Kali 2020
    【Linux】Centos7密码登录失败锁定设置_20200313
    【Linux】如何设置Linux开机 ,默认进入图形界面或命令行界面?
    【Linux】使用 PXE+Kickstart 无人值守批量安装系统
    【Linux】Linux修改openfile和max user processes?
  • 原文地址:https://www.cnblogs.com/wkun/p/4374016.html
Copyright © 2011-2022 走看看