you can use fieldset to achive that goal.
<form>
<fieldset>
<legend>Personalia:</legend>
Name: <input type="text"><br>
Email: <input type="text"><br>
Date of birth: <input type="text">
</fieldset>
</form>
This is a vertical list of similar elements. So you can use Recyclerview for them. Inside an item you can use new Chip view (see https://medium.com/material-design-in-action/chips-material-components-for-android-46001664a40f ).
You can only set background color of cardview, cannot directly set border color. So, keep a drawable file for background as follows :
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<stroke android:width="3dp" android:color="#abc" />
<corners android:radius="20dp"/>
</shape>
You can use the following layout to achieve the required style :
<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="match_parent"
tools:context=".MainActivity">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="100dp"
android:layout_marginTop="15dp"
android:background="@drawable/border"><!--You can add your necessary content within this layout-->
</RelativeLayout>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="#ffffff"
android:layout_marginLeft="25dp"
android:text="Sample Text"
android:textSize="20sp"/>
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.