Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/199.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/xml/14.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Android-不透明度渐变可绘制_Android_Xml_Resources_Drawable - Fatal编程技术网

Android-不透明度渐变可绘制

Android-不透明度渐变可绘制,android,xml,resources,drawable,Android,Xml,Resources,Drawable,有没有可能,只使用可绘制工具创建一个向外辐射的白色模糊的黑色背景 以下是最终产品,齿轮是ImageViwe,文本是TextView,我希望黑白模糊是一个可绘制的,我可以将其分配给包含的线性布局: 下面是最终在GridView中使用的布局的代码。如果可能,我想将LinearLayout的背景设置为上述可绘制的: <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.an

有没有可能,只使用可绘制工具创建一个向外辐射的白色模糊的黑色背景

以下是最终产品,齿轮是ImageViwe,文本是TextView,我希望黑白模糊是一个可绘制的,我可以将其分配给包含的线性布局:

下面是最终在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>

当然,以下是可绘制的径向渐变,将用作背景。更改颜色/渐变半径以获得所需效果。在drawable文件夹radialbg中创建xml文件,或者选择哪个名称

<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"      
        android:shape="rectangle">
<gradient
    android:startColor="#FFFFFFFF"
    android:endColor="#00FFFFFF"
    android:gradientRadius="270"
    android:type="radial"/>

</shape>

当然,以下是可绘制的径向渐变,将用作背景。更改颜色/渐变半径以获得所需效果。在drawable文件夹radialbg中创建xml文件,或者选择哪个名称

<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"      
        android:shape="rectangle">
<gradient
    android:startColor="#FFFFFFFF"
    android:endColor="#00FFFFFF"
    android:gradientRadius="270"
    android:type="radial"/>

</shape>