GridView是类似于ListView的控件,只是GridView可以使用多个列来呈现内容,而ListView是以行为单位,所以用法上是差不多的。
主布局文件,因为要做下拉刷新,所以加了一个ProgressBar,GridView的numColumns属性是指每一行有多少列
<RelativeLayout xmlns:android=http://schemas.android.com/apk/res/android
xmlns:tools=http://schemas.android.com/tools
android:layout_width=match_pare