现在想要使用该适配器做出下面的效果:
废话不多说,直接贴出代码:
setContentView(R.layout.activity_main);所加载的布局文件:
<ListView
android:id="@+id/list_test"
android:layout_width="wrap_content"
android:layout_height="wrap_content">
</ListView>
具体样式布局文件:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="horizontal">
<!--这是一个用于显示头像的ImageView-->
<ImageView
android:id="@+id/imgtou"
android:layout_width="64dp"
android:layout_height="64dp"
android:baselineAlignBottom="true"
android:paddingLeft="8dp"
/>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"