Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/mercurial/2.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_Android Layout - Fatal编程技术网

Android 如何在给定的图像中添加线条交叉布局?

Android 如何在给定的图像中添加线条交叉布局?,android,android-layout,Android,Android Layout,我想让我的布局像下面的图片一样,我在最后添加。我可以旋转并添加图像中的图片,但问题是,线条超出了边框 那么,我如何才能完美地将其置于边界内 <RelativeLayout android:layout_width="match_parent" android:layout_height="150dp" android:background="@drawable/cover_pic_backgro

我想让我的布局像下面的图片一样,我在最后添加。我可以旋转并添加图像中的图片,但问题是,线条超出了边框

那么,我如何才能完美地将其置于边界内

<RelativeLayout
                android:layout_width="match_parent"
                android:layout_height="150dp"
                android:background="@drawable/cover_pic_background"
                >

                <LinearLayout
                    android:layout_width="match_parent"
                    android:layout_height="50dp"
                    android:background="#736f6f"
                    >

                    <ImageView
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:src="@drawable/star"
                        />

                    <TextView
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:text="Certified"
                        android:layout_gravity="center"
                        android:textSize="30sp"

                        />

                    <ImageView
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:src="@drawable/star"

                        />

                </LinearLayout>

                <ImageView
                    android:layout_width="match_parent"
                    android:layout_height="match_parent"
                    android:id="@+id/imageViewId_CoverPic"
                    android:scaleType="centerInside"
                    android:padding="3dp"
                    />

                <ImageView
                    android:id="@+id/inside_imageview"
                    android:layout_width="80dp"
                    android:layout_height="90dp"
                    android:layout_marginStart="39dp"
                    android:layout_alignParentBottom="true"
                    android:layout_alignParentStart="true"
                    android:scaleType="centerInside"
                    android:background="@drawable/cover_pic_background"
                    android:elevation="5dp"
                    />

            </RelativeLayout>

试试这个

 <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="250dp"
    android:layout_margin="10dp">

    <ImageView
        android:id="@+id/nilu"
        android:layout_width="match_parent"
        android:layout_height="250dp"
        android:src="@color/colorAccent" />

    <ImageView
        android:id="@+id/imageView"
        android:layout_width="250dp"
        android:layout_height="150dp"

        android:layout_alignBottom="@+id/nilu"
        android:layout_alignParentStart="true"
        android:src="@mipmap/ic_launcher_round" />


    <TextView
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_alignEnd="@+id/imageView"
        android:layout_alignTop="@+id/imageView"
        android:layout_marginLeft="-70dp"
        android:background="@color/colorPrimary"
        android:padding="10dp"
        android:paddingStart="50dp"
        android:rotation="-50"
        android:layout_marginTop="-10dp"
        android:text="certified profile"
        android:textColor="#ffffff" />

</RelativeLayout>

输出 试试这个

 <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="250dp"
    android:layout_margin="10dp">

    <ImageView
        android:id="@+id/nilu"
        android:layout_width="match_parent"
        android:layout_height="250dp"
        android:src="@color/colorAccent" />

    <ImageView
        android:id="@+id/imageView"
        android:layout_width="250dp"
        android:layout_height="150dp"

        android:layout_alignBottom="@+id/nilu"
        android:layout_alignParentStart="true"
        android:src="@mipmap/ic_launcher_round" />


    <TextView
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_alignEnd="@+id/imageView"
        android:layout_alignTop="@+id/imageView"
        android:layout_marginLeft="-70dp"
        android:background="@color/colorPrimary"
        android:padding="10dp"
        android:paddingStart="50dp"
        android:rotation="-50"
        android:layout_marginTop="-10dp"
        android:text="certified profile"
        android:textColor="#ffffff" />

</RelativeLayout>

输出
使用此设计制作透明图像。并把它放在个人资料图片上


使用此设计制作透明图像。并把它放在个人资料图片上


使用框架布局将很容易实现请通过此链接进行解释请使用框架布局将很容易实现请通过此链接进行解释please@AAA很高兴帮助你我同时做到了:)一个问题我已经按照我想要的方式做了,但有一个问题,为什么我的旋转部分放在其他视图下面?@AAA没有检查我的代码。所有视图下面都显示了linearlayout,但我想首先显示它。怎么做?@AAA很高兴帮助你我同时做到了:)一个问题我已经按照我想要的方式做了,但有一个问题,为什么我的旋转部分放在另一个视图下面?@AAA没有检查我的代码。所有视图下面都显示了linearlayout,但我想首先显示它。怎么做?