Andrid应用程序开发(上)讲解.ppt

Andrid应用程序开发(上)讲解

Android常见控件 图像控件—GridView GridView控件用于把一系列的空间组织成一个二维的网格显示出来。 1.GridView在布局文件中的配置 GridView android:id=@+id/gridview android:layout_width=fill_parent android:layout_height=wrap_content android:columnWidth=90dp android:numColumns=auto_fit android:verticalSpacing=10dp android:horizontalSpacing=10dp android:stretchMode=columnWidth android:gravity=center“ / 2.根据id获取GridView对象 gridview=(GridView)findViewById(R.id.gridview); 3.创建内容字符串对象 list=new String[]{C++,JavaScript,C,Java}; 4.创建适配器 ArrayAdapterString adapter=new ArrayAdapterString(this,

文档评论(0)

1亿VIP精品文档

相关文档