欧美bbbwbbbw肥妇,免费乱码人妻系列日韩,一级黄片

Android控件陰影顏色調(diào)整示例

 更新時(shí)間:2018年08月17日 09:10:24   作者:她的夢(mèng)z  
這篇文章主要介紹了Android控件陰影顏色調(diào)整示例,小編覺得挺不錯(cuò)的,現(xiàn)在分享給大家,也給大家做個(gè)參考。一起跟隨小編過來看看吧

CardView在設(shè)置陰影的效果上來講,確實(shí)是蠻不錯(cuò)的。

但是涉及到變更陰影顏色這個(gè)需求,就不是太好操作。

然后就自己描邊畫了一個(gè)陰影效果,分享,支持任何顏色。

效果:

xml-selector

<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
  <item android:state_enabled="true">
    <layer-list>
      <item android:right="1dp" android:top="2dp">
        <layer-list>
          <item>
            <shape android:shape="rectangle">
              <solid android:color="#15cbf2e0" />
              <padding android:bottom="6px" android:left="6px" android:right="6px" android:top="6px" />
            </shape>
          </item>
          <item>
            <shape android:shape="rectangle">
              <solid android:color="#16cbf2e0" />
              <padding android:bottom="4px" android:left="4px" android:right="4px" android:top="4px" />
            </shape>
          </item>
          <item>
            <shape android:shape="rectangle">
              <solid android:color="#17cbf2e0" />
              <padding android:bottom="2px" android:left="2px" android:right="2px" android:top="2px" />
            </shape>
          </item>
          <item>
            <shape android:shape="rectangle">
              <solid android:color="#18cbf2e0" />
              <padding android:bottom="3px" android:left="2px" android:right="2px" android:top="1px" />
            </shape>
          </item>
          <item>
            <shape android:shape="rectangle">
              <solid android:color="#19cbf2e0" />
              <padding android:bottom="3px" android:left="2px" android:right="2px" android:top="1px" />
            </shape>
          </item>
          <item>
            <shape android:shape="rectangle">
              <solid android:color="#20cbf2e0" />
              <padding android:bottom="3px" android:left="2px" android:right="2px" android:top="1px" />
            </shape>
          </item>
          <item>
            <shape android:shape="rectangle">
              <solid android:color="#21cbf2e0" />
              <padding android:bottom="3px" android:left="2px" android:right="2px" android:top="1px" />
            </shape>
          </item>
          <item>
            <shape android:shape="rectangle">
              <solid android:color="#22cbf2e0" />
              <padding android:bottom="3px" android:left="2px" android:right="2px" android:top="1px" />
            </shape>
          </item>
          <item>
            <shape android:shape="rectangle">
              <solid android:color="#23cbf2e0" />
              <padding android:bottom="3px" android:left="2px" android:right="2px" android:top="1px" />
            </shape>
          </item>
        </layer-list>
      </item>
      <item>
        <shape android:shape="rectangle">
          <solid android:color="@color/white" />
        </shape>
      </item>
    </layer-list>
  </item>
</selector>

關(guān)于描邊的大小什么的,都可以自己設(shè)置,顏色也一樣。都自己隨意。

使用起來也是非常簡(jiǎn)單,

android:background="@drawable/lay_back"

以上就是本文的全部?jī)?nèi)容,希望對(duì)大家的學(xué)習(xí)有所幫助,也希望大家多多支持腳本之家。

相關(guān)文章

最新評(píng)論