有时我们需要在空间看到说说发布一张图片变得很大,多发几张图片就变小了,为了实现这个效果我们就需要Gridview 和它的Adapter
下面是GridView的代码
activity_grid_test.xml
<LineaLayout 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"
tools:context="com.rindiaco.myweibo.GridTestActivity">
<GridView
android:id="@+id/testimggridview"
android:layout_width="match_parent"
android:layout_height="wrap_content"
>
</GridView>
</LineaLayout >
这里的numColumns我们在gridview 的绑定环境再设置
Activity代码
GridTestActivity.java
public class GridTestActivity