以下是实现的通过GridView加载广告图片(没有加载文字),上面的“今日推荐”,“更多”字样是通过Layout布局实现的。通过添加监听器,点击每一个图片,并且携带图片的Id进行转跳
这是一个GridView容器,用来放后面的gridview_tuijian_item,包括附加了上面的一个标题行“今日推荐”,“更多”
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical" >
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="16dp"
android:layout_marginRight="16dp"
android:background="#ccc" >
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:text="今日推荐"
android:textSize="16sp"
android:textStyle="bold" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
andr