android - 圆角方形背景形状,右上角有切出的圆圈
解决方案
尝试这个....
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout 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="wrap_content"
android:layout_height="wrap_content"
android:background="@android:color/white">
<RelativeLayout
android:id="@+id/view"
android:layout_width="100dp"
android:layout_height="100dp"
android:layout_marginTop="24dp"
android:layout_marginEnd="24dp"
android:background="@drawable/roundcorner"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<RelativeLayout
android:layout_width="40dp"
android:layout_height="40dp"
android:background="@drawable/round"
app:layout_constraintBottom_toTopOf="@+id/view"
app:layout_constraintEnd_toEndOf="@+id/view"
app:layout_constraintStart_toEndOf="@+id/view"
app:layout_constraintTop_toTopOf="@+id/view" />
</androidx.constraintlayout.widget.ConstraintLayout>
圆形.xml
<?xml version="1.0" encoding="utf-8"?>
<shape android:shape="oval"
xmlns:android="http://schemas.android.com/apk/res/android">
<solid android:color="#c20586"/>
<stroke android:width="5dp"
android:color="@android:color/white"/>
</shape>
圆角.xml
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<solid android:color="#ffa800" />
<corners android:radius="10dp" />
</shape>
我希望它有帮助..
推荐阅读
- typescript - Vuetify 和 nuxt.js - 规则应该返回一个字符串或布尔值,而不是收到“未定义”
- dart - Dart 中的 For-in 循环
- node.js - TypeError:无法读取未定义的属性“simpleResponse”
- language-features - 'inplace operation' 运算符有任何语言版本吗?
- sql-server - 如何执行“分组依据”之类的操作以在一个字段上运行但在查询中包含所有字段
- asp.net-mvc - 从支付网关.Net MVC 5 重定向后,Google Chrome 版本 84.0.4147.125 会话变为空
- react-native - 尝试移动应用程序入口点不起作用(EXPO)
- python - 在 jupyter notebook 中执行代码存在问题
- python - Python3 - 将数组排序为特定顺序
- python - 动态重命名熊猫df