android - 如何为顶部圆形图像附加到背景图像的背景图像提供角半径?
问题描述
如何为背景封面图片赋予圆角半径,上面的圆角图片附有这个。谁能帮我得到这个设计?像这张图片......期待这个,但现在我只能得到这个得到这个。
<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>
解决方案
推荐阅读
- python - 单击按钮从一个页面转到另一个页面时出现 Django 问题
- javascript - 使用 Javascript 自动提交表单
- python - Tensorflow 在对象检测会话运行中抛出“TypeError: unhashable type: 'list'”错误
- mongodb - MongoDB (Docker) 错误 20 - 尝试启动事务时出现非法操作
- java - 通过邮递员发送 JSON 数据,在 Spring Boot Jpa 项目中给出 Failed to evaluate Jackson 反序列化类型
- r - updateSelectInput 调用后如何重新分配输入?
- python - 从数据框中的最后一个可用日期中提取最近 30 天的数据框
- typescript - 如何通过升序和降序验证日期从数组中正确显示
- java - 启动 Cassandra 的问题。Java 运行时环境检测到一个致命错误:
- react-native - 如何在不破坏其状态的情况下保持安装屏幕并在反应导航 5 中在屏幕之间来回导航?