Android直播系統(tǒng)平臺搭建之圖片實現(xiàn)陰影效果的方法小結
Android直播系統(tǒng)平臺搭建, 圖片實現(xiàn)陰影效果的若干種方法,下面給大家列舉了三種方法,具體代碼如下所示:
第一種 使用 layer-list
<?xml version="1.0" encoding="utf-8"?> <layer-list xmlns:android="http://schemas.android.com/apk/res/android"> <!--底層的左邊距離上層左邊3dp, 底層的頂部,距離上層的頂部6dp,如果不做這個控制,底層和上層的左側和上側會重合在一起--> <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,分別指的是陰影的橫、縱坐標偏移,以及陰影的半徑,
如果是TextView可以直接在布局中設置:
<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"/>
到此這篇關于Android直播系統(tǒng)平臺搭建, 圖片實現(xiàn)陰影效果的若干種方法的文章就介紹到這了,更多相關Android直播系統(tǒng)平臺搭建內(nèi)容請搜索腳本之家以前的文章或繼續(xù)瀏覽下面的相關文章希望大家以后多多支持腳本之家!
相關文章
實例講解Android app開發(fā)中ListView的基本使用及優(yōu)化
這篇文章主要介紹了Android app開發(fā)中ListView的基本使用及優(yōu)化,ListView視圖組件是Android中最常用的組件之一需要的朋友可以參考下2016-02-02解決EditText編輯時hint 在6.0 手機上顯示不出來的問題
下面小編就為大家?guī)硪黄鉀QEditText編輯時hint 在6.0 手機上顯示不出來的問題。小編覺得挺不錯的,現(xiàn)在就分享給大家,也給大家做個參考。一起跟隨小編過來看看吧2017-05-05TextView顯示系統(tǒng)時間(時鐘功能帶秒針變化
用System.currentTimeMillis()可以獲取系統(tǒng)當前的時間,我們可以開啟一個線程,然后通過handler發(fā)消息,來實時的更新TextView上顯示的系統(tǒng)時間,可以做一個時鐘的功能2013-11-11