要想Toolbar跟隨Listview的滑動擴展或者是收縮這中聯動效果,需要在ListView中配置如下屬性: android:nestedScrollingEnabled=”true”
<ListView android:id="@+id/station_show" android:layout_width="match_parent" android:layout_height="match_parent" android:nestedScrollingEnabled="true" android:scrollbars="none" />
GridView同理,不過這個屬性sdk>21纔會有效,產生效果