吸顶效果最重要的在布局上首先把几个布局写下
activity_main
<?xml version="1.0" encoding="utf-8"?>
<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"
android:orientation="vertical"
tools:context=".MainActivity">
<ListView
android:id="@+id/plv"
android:layout_width="match_parent"
android:layout_height="match_parent"
/>
<TextView
android:id="@+id/header_title"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/colorAccent"
android:gravity="center_horizontal"
android:paddingTop="15dp"
android:text="2016-12-28"
android:textSize="20sp"/>
</RelativeLayout>
list_hander
<?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="vertical">
<ImageView
android:id="@+id/header_iv"
android:layout_width="match_parent"
android:layout_height="200dp"
android:background="@mipmap/ic_launcher"
/>
</LinearLayout>
view_item_app_info
<?xml version="1.0" encoding="utf-8"?&