android - 如何使用自定义形状创建 RecycleView?
解决方案
您可以将此布局用作您的行
<?xml version="1.0" encoding="utf-8"?>
<android.support.v7.widget.CardView xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="80dp"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_margin="10dp"
app:cardCornerRadius="10dp"
>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="horizontal"
>
<View
android:layout_width="20dp"
android:layout_height="20dp"
android:layout_gravity="center"
android:layout_marginStart="-10dp"
android:background="@drawable/shape_example_circle"
/>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
>
`enter code here`Make your view here
</RelativeLayout>
<View
android:layout_width="20dp"
android:layout_height="20dp"
android:layout_gravity="center"
android:layout_marginEnd="-10dp"
android:background="@drawable/shape_example_circle"
/>
</LinearLayout>
</android.support.v7.widget.CardView>
小圆可绘制
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="oval"
>
<size android:height="@dimen/dp_20"
android:width="@dimen/dp_20"/>
<solid android:color="@color/greyish"/>
</shape>
推荐阅读
- arrays - 返回最后一个非空白单元格的行号,从一列的第一行到当前行进行比较,使用数组公式
- javascript - 从一个 html 文件中获取数据并使用另一个 html 文件显示它
- python-3.x - 在 Python 中为先验准备数据集
- jmeter - 如何在 jmeter 中为以下脚本编写 json 路径表达式。需要两个动态值 session id 和 csrf
- java - java中使用CSV解析器的键值解析器实现
- c# - 使用 api 密钥使用 Web API 时,出现以下错误 - 远程服务器返回错误:(403) Forbidden
- java - 默认目录必须是绝对目录
- google-calendar-api - 谷歌日历活动
- javascript - Google Sheets API v4:添加命名或受保护的范围
- ocaml - OCaml 中的参数多态性问题