Android 如何设计材料设计指南中的列表示例?
我正在学习Android编程,我正试图准确地再现特定列表项示例的布局,但我不确定如何实现: 你能给我一些帮助吗?Android 如何设计材料设计指南中的列表示例?,android,android-layout,material-design,Android,Android Layout,Material Design,我正在学习Android编程,我正试图准确地再现特定列表项示例的布局,但我不确定如何实现: 你能给我一些帮助吗? 谢谢。1-在您的drawables中添加一个新的xml文件,并将其命名为“circle\u avatar.xml” 并插入以下代码: <shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle"> <corners
谢谢。1-在您的drawables中添加一个新的xml文件,并将其命名为“circle\u avatar.xml” 并插入以下代码:
<shape
xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<corners
android:radius="100dip"/>
<solid
android:color="#ff4CAF50" />
<stroke
android:width="2dip"
android:color="#FFF" />
<padding
android:left="6dip"
android:right="6dip"
android:top="5dip"
android:bottom="5dip" />
</shape>
2-在主xml布局中:
<FrameLayout
android:layout_width="40dp"
android:layout_height="40dp"
android:layout_marginRight="20dp"
android:layout_marginTop="10dp"
android:id="@+id/layout_circle_avatar"
android:layout_gravity="center_vertical"
android:background="@drawable/circle_avatar">
<ImageView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:id="@+id/circle_pic"
android:src="@drawable/icon1"/>
</FrameLayout>
PS.您可以随时根据需要对其进行更改