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中用xml设计下图?_Android_Xml_Androiddesignsupport - Fatal编程技术网

如何在android中用xml设计下图?

如何在android中用xml设计下图?,android,xml,androiddesignsupport,Android,Xml,Androiddesignsupport,如何在android中使用xml进行设计,如下面的image 渐变: compile 'de.hdodenhof:circleimageview:2.1.0' XML: 查看我用于自定义对话框的解决方案 -- XML设计 <?xml version="1.0" encoding="utf-8"?> <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"

如何在android中使用xml进行设计,如下面的
image

渐变:

compile 'de.hdodenhof:circleimageview:2.1.0'
XML:



查看我用于自定义对话框的解决方案

--

XML设计

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
                android:layout_width="match_parent"
                android:layout_height="match_parent"
                android:background="@color/colorTransparent">


    <RelativeLayout
        android:layout_width="match_parent"
        android:layout_height="200dp"
        android:background="@color/colorTransparent">


        <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="200dp"
            android:layout_marginTop="24dp"
            android:background="@color/colorBlackFaint"
            android:gravity="center_horizontal"
            android:orientation="horizontal"
            android:padding="24dp">


            <TextView
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_marginTop="16dp"
                android:text="Custom Dialog"
                android:textColor="@color/colorWhite"
                android:textSize="16sp"/>

        </LinearLayout>

        <ImageView
            android:id="@+id/topImg"
            android:layout_width="48dp"
            android:layout_height="48dp"
            android:layout_alignParentTop="true"
            android:layout_centerHorizontal="true"
            android:background="@drawable/circle_view"
            android:scaleType="fitXY"
            android:src="@drawable/ic_check_offf"/>

    </RelativeLayout>


</RelativeLayout>

像这样输出


使用框架布局欢迎使用StackOverflow。请学习询问好问题stackoverflow.com/help/how-to-askis此xml定制对话框设计??
Dialog  mDlg = new Dialog(SplashActivity.this);
        mDlg.requestWindowFeature(Window.FEATURE_NO_TITLE);
        mDlg.setContentView(R.layout.layout_head_dialog);
        mDlg.getWindow().setBackgroundDrawable(new ColorDrawable(android.graphics.Color.TRANSPARENT));
        mDlg.show();
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
                android:layout_width="match_parent"
                android:layout_height="match_parent"
                android:background="@color/colorTransparent">


    <RelativeLayout
        android:layout_width="match_parent"
        android:layout_height="200dp"
        android:background="@color/colorTransparent">


        <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="200dp"
            android:layout_marginTop="24dp"
            android:background="@color/colorBlackFaint"
            android:gravity="center_horizontal"
            android:orientation="horizontal"
            android:padding="24dp">


            <TextView
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_marginTop="16dp"
                android:text="Custom Dialog"
                android:textColor="@color/colorWhite"
                android:textSize="16sp"/>

        </LinearLayout>

        <ImageView
            android:id="@+id/topImg"
            android:layout_width="48dp"
            android:layout_height="48dp"
            android:layout_alignParentTop="true"
            android:layout_centerHorizontal="true"
            android:background="@drawable/circle_view"
            android:scaleType="fitXY"
            android:src="@drawable/ic_check_offf"/>

    </RelativeLayout>


</RelativeLayout>