如何在顶部圆角图像附加到背景图像的背景图像上赋予圆角半径?

时间:2019-01-23 10:51:12

标签: android android-layout android-xml android-xml-attribute

如何在背景封面图片上加上圆角半径,以赋予背景封面图片圆角半径。谁能帮我得到这个设计?就像这张图片一样……Expecting this,但是现在我才能够得到这个Getting this

<com.google.android.material.appbar.AppBarLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="wrap_content">

    <com.google.android.material.appbar.CollapsingToolbarLayout
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        app:layout_scrollFlags="scroll|snap|exitUntilCollapsed">

        <RelativeLayout
            android:id="@+id/layoutTop"
            android:layout_width="match_parent"
            android:layout_height="150dp"
            android:background="@color/bgColor"
            app:layout_collapseMode="pin">
            <LinearLayout
                android:orientation="vertical"
                android:layout_width="match_parent"
                android:layout_height="match_parent">
                <ImageView
                    android:id="@+id/coverImg"
                    android:layout_width="match_parent"
                    android:layout_height="80dp"
                    android:scaleType="centerCrop"
                    android:background="@drawable/coverImg"/>
            </LinearLayout>
            <de.hdodenhof.circleimageview.CircleImageView
                android:id="@+id/mainRoundImage"
                android:src="@drawable/roundImg"
                app:civ_border_color="@color/borderColor"
                app:civ_border_width="8dp"
                android:layout_width="100dp"
                android:layout_height="100dp"
                android:layout_centerHorizontal="true"
                android:layout_marginTop="24dp"/>

        </RelativeLayout>

    </com.google.android.material.appbar.CollapsingToolbarLayout>

</com.google.android.material.appbar.AppBarLayout>

0 个答案:

没有答案
相关问题