1
是否有可能使用drawables創建具有向外輻射白色模糊的黑色背景?Android - 不透明度淡化可繪製
這是最終產品的樣子,雖然齒輪是一個ImageViwe,而文本是一個TextView,我希望黑色+白色模糊是一個可繪製的,我可以分配給含的LinearLayout:
下面是佈局(最終在GridView使用)的代碼。我想在的LinearLayout的背景設置爲上述可繪製如果可能的話:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_margin="10dp"
android:background="#000000"
android:gravity="center_vertical|center_horizontal"
android:orientation="vertical"
android:padding="5dp" >
<ImageView
android:id="@+id/tile_image"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="10dp"
android:adjustViewBounds="true"
android:contentDescription="@string/temp_image"
android:src="@drawable/ic_logo" />
<TextView
android:id="@+id/tile_title"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
</LinearLayout>