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

Android直播系統(tǒng)平臺(tái)搭建之圖片實(shí)現(xiàn)陰影效果的方法小結(jié)

 更新時(shí)間:2021年08月27日 14:47:50   作者:云豹科技-蘇凌霄  
這篇文章主要介紹了Android直播系統(tǒng)平臺(tái)搭建, 圖片實(shí)現(xiàn)陰影效果的若干種方法,本文給大家?guī)砣N方法,每種方法通過實(shí)例代碼給大家介紹的非常詳細(xì),需要的朋友可以參考下

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)文章

最新評(píng)論