写一个好友列表布局abddoid
时间: 2023-07-07 22:40:29 浏览: 45
好的,以下是一个简单的好友列表布局代码示例:
```xml
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent">
<!-- 标题栏 -->
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:padding="16dp"
android:background="@color/colorPrimary">
<TextView
android:id="@+id/title_tv"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="好友列表"
android:textColor="#fff"
android:textSize="20sp" />
<ImageView
android:id="@+id/back_iv"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/ic_back"
android:layout_alignParentRight="true"
android:layout_centerVertical="true"
android:padding="8dp" />
</RelativeLayout>
<!-- 好友列表 -->
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/friend_list_rv"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:padding="16dp" />
</LinearLayout>
```
这个布局包含一个标题栏和一个RecyclerView,RecyclerView用于展示好友列表。你可以根据自己的需求进行调整和修改。