1
如何创建的ListView像这样的ListView项,如何创建与材料方针
谷歌已经对本文档,
https://material.io/guidelines/layout/metrics-keylines.html#metrics-keylines-keylines-spacing
但没有交代如何使这个,
这是我迄今为止的尝试,我不确定margin/padding和分隔符是否有任何教程如何使此布局
这是RecyclerView项目布局:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/parent_view"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:clickable="true"
android:focusable="true"
android:foreground="?attr/selectableItemBackground"
android:paddingLeft="16dp"
android:paddingRight="16dp"
android:transitionName="parent_view"
tools:ignore="UnusedAttribute">
<ImageView
android:id="@+id/image_layanan"
android:layout_width="40dp"
android:layout_height="40dp"
android:layout_marginTop="16dp"
android:transitionName="image_layanan"/>
<TextView
android:id="@+id/text_layanan"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="16dp"
android:layout_marginStart="16dp"
android:layout_marginTop="10dp"
android:layout_toEndOf="@id/image_layanan"
android:layout_toRightOf="@+id/image_layanan"
android:textAppearance="?attr/textAppearanceListItem"
android:textSize="16sp"
android:transitionName="text_layanan"
tools:text="string/item_title"/>
<TextView
android:id="@+id/text_dokter"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@+id/text_layanan"
android:layout_marginLeft="16dp"
android:layout_marginStart="16dp"
android:layout_toEndOf="@+id/image_layanan"
android:layout_toRightOf="@+id/image_layanan"
android:ellipsize="end"
android:maxLines="1"
android:textAppearance="?attr/textAppearanceListItem"
android:textColor="#212121"
android:textSize="14sp"
android:transitionName="text_dokter"
tools:text="string/item_desc"/>
<TextView
android:id="@+id/text_jam"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@id/text_dokter"
android:layout_marginLeft="16dp"
android:layout_marginStart="16dp"
android:layout_toEndOf="@id/image_layanan"
android:layout_toRightOf="@id/image_layanan"
android:textSize="13sp"
android:transitionName="text_jam"/>
<TextView
android:id="@+id/text_pasien"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@id/text_jam"
android:layout_marginBottom="14dp"
android:layout_marginLeft="16dp"
android:layout_marginStart="16dp"
android:layout_toEndOf="@id/image_layanan"
android:layout_toRightOf="@id/image_layanan"
android:textSize="13sp"
android:transitionName="text_pasien"/>
<View
android:layout_width="match_parent"
android:layout_height="1px"
android:layout_alignLeft="@+id/text_pasien"
android:layout_alignStart="@+id/text_pasien"
android:layout_below="@+id/text_pasien"
android:background="#212121"/>
</RelativeLayout>
你想要什么知道吗?关于设计部分?或者在java中的完整实现 – MrLeblond
设计部分,我认为我的设计不对。 – nyongrand
等分频器 – nyongrand