国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 系統 > Android > 正文

Android控件陰影顏色調整示例

2019-10-21 21:41:19
字體:
來源:轉載
供稿:網友

CardView在設置陰影的效果上來講,確實是蠻不錯的。

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

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

效果:

Android,控件,陰影顏色

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>

關于描邊的大小什么的,都可以自己設置,顏色也一樣。都自己隨意。

使用起來也是非常簡單,

android:background="@drawable/lay_back"

以上就是本文的全部內容,希望對大家的學習有所幫助,也希望大家多多支持VEVB武林網。

 

注:相關教程知識閱讀請移步到Android開發頻道。
發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 湖州市| 民权县| 望江县| 酒泉市| 蒙山县| 怀远县| 沙雅县| 民丰县| 德化县| 驻马店市| 容城县| 昂仁县| 无棣县| 嵊泗县| 梁平县| 通海县| 仁布县| 武义县| 南郑县| 常州市| 额济纳旗| 嵊泗县| 林州市| 德安县| 韶山市| 江安县| 北碚区| 同仁县| 宁武县| 怀远县| 慈溪市| 霍邱县| 灵丘县| 绥中县| 武清区| 湖南省| 乌什县| 吉林市| 西乌珠穆沁旗| 宣恩县| 台中市|