国产探花免费观看_亚洲丰满少妇自慰呻吟_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開發頻道。
發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 新蔡县| 彭州市| 永福县| 清徐县| 永泰县| 获嘉县| 遵化市| 禄丰县| 望都县| 南投市| 淄博市| 长寿区| 江安县| 扶风县| 兴义市| 华池县| 波密县| 通海县| 沅陵县| 贵溪市| 峨边| 阳谷县| 康保县| 汤阴县| 且末县| 黄山市| 梁河县| 临夏县| 疏附县| 庆安县| 招远市| 土默特右旗| 云浮市| 景谷| 汶川县| 灵璧县| 扎囊县| 榆树市| 揭阳市| 紫阳县| 东乌|