Android直播系統(tǒng)平臺(tái)搭建之圖片實(shí)現(xiàn)陰影效果的方法小結(jié)
Android直播系統(tǒng)平臺(tái)搭建, 圖片實(shí)現(xiàn)陰影效果的若干種方法,下面給大家列舉了三種方法,具體代碼如下所示:
第一種 使用 layer-list
<?xml version="1.0" encoding="utf-8"?> <layer-list xmlns:android="http://schemas.android.com/apk/res/android"> <!--底層的左邊距離上層左邊3dp, 底層的頂部,距離上層的頂部6dp,如果不做這個(gè)控制,底層和上層的左側(cè)和上側(cè)會(huì)重合在一起--> <item android:left="3dp" android:top="6dp"> <shape> <solid android:color="#b4b5b6"/> </shape> </item> <!--上層的右邊距離底層的右邊3dp, 上層的底部距離底層的底部6dp--> <item android:bottom="6dp" android:right="3dp"> <shape> <solid android:color="#fff"/> </shape> </item> </layer-list>
第二種 使用 shadow屬性
shadowDX、shadowDy、shadowRadius,分別指的是陰影的橫、縱坐標(biāo)偏移,以及陰影的半徑,
如果是TextView可以直接在布局中設(shè)置:
<TextView android:id="@+id/test_shadow" android:layout_width="wrap_content" android:layout_height="wrap_content" android:textSize="60sp" android:textColor="#cc000000" android:text="Test Shadow" android:layout_gravity="center" android:shadowColor="#aa22ff22" android:shadowRadius="10" android:shadowDx="0" android:shadowDy="0" />
第三種 使用android:elevation屬性
<TextView android:id="@+id/btn_test_performance" android:layout_width="wrap_content" android:layout_height="wrap_content" android:elevation="5dp" android:text="@string/hello" android:background="@drawable/shape_round_white" android:padding="20dp" android:layout_marginTop="10dp" android:layout_gravity="center"/>
到此這篇關(guān)于Android直播系統(tǒng)平臺(tái)搭建, 圖片實(shí)現(xiàn)陰影效果的若干種方法的文章就介紹到這了,更多相關(guān)Android直播系統(tǒng)平臺(tái)搭建內(nèi)容請(qǐng)搜索腳本之家以前的文章或繼續(xù)瀏覽下面的相關(guān)文章希望大家以后多多支持腳本之家!
相關(guān)文章
Android庫項(xiàng)目中的資源ID沖突的解決方法
本篇文章主要介紹了Android庫項(xiàng)目中的資源ID沖突的解決方法,小編覺得挺不錯(cuò)的,現(xiàn)在分享給大家,也給大家做個(gè)參考。一起跟隨小編過來看看吧2018-03-03Android文字匹配度算法及實(shí)際應(yīng)用示例
本文介紹了Android應(yīng)用中常用的文字匹配度算法Levenshtein Distance,并給出了實(shí)際應(yīng)用示例,通過合理選擇和應(yīng)用文字匹配度算法,可以實(shí)現(xiàn)多種功能,提升用戶體驗(yàn),增強(qiáng)應(yīng)用的實(shí)用性,需要的朋友可以參考下2024-05-05實(shí)例講解Android app開發(fā)中ListView的基本使用及優(yōu)化
這篇文章主要介紹了Android app開發(fā)中ListView的基本使用及優(yōu)化,ListView視圖組件是Android中最常用的組件之一需要的朋友可以參考下2016-02-02解決EditText編輯時(shí)hint 在6.0 手機(jī)上顯示不出來的問題
下面小編就為大家?guī)硪黄鉀QEditText編輯時(shí)hint 在6.0 手機(jī)上顯示不出來的問題。小編覺得挺不錯(cuò)的,現(xiàn)在就分享給大家,也給大家做個(gè)參考。一起跟隨小編過來看看吧2017-05-05Android仿微信文章懸浮窗效果的實(shí)現(xiàn)代碼
這篇文章主要介紹了Android仿微信文章懸浮窗效果的實(shí)現(xiàn)代碼,需要的朋友可以參考下2018-10-10Android 指紋識(shí)別詳解及實(shí)現(xiàn)方法
本文主要介紹Android 指紋識(shí)別的知識(shí),這里整理了詳細(xì)的資料和簡(jiǎn)單實(shí)現(xiàn)代碼,有開發(fā)這部分的朋友可以參考下2016-09-09TextView顯示系統(tǒng)時(shí)間(時(shí)鐘功能帶秒針變化
用System.currentTimeMillis()可以獲取系統(tǒng)當(dāng)前的時(shí)間,我們可以開啟一個(gè)線程,然后通過handler發(fā)消息,來實(shí)時(shí)的更新TextView上顯示的系統(tǒng)時(shí)間,可以做一個(gè)時(shí)鐘的功能2013-11-11