Android UI学习 - GridView和ImageView的使用.docxVIP

  • 4
  • 0
  • 约4.79千字
  • 约 6页
  • 2022-06-23 发布于上海
  • 举报

Android UI学习 - GridView和ImageView的使用.docx

GridView: A view that shows items in two-dimensional scrolling grid. The items in the grid come from the ListAdapter associated with this view. 简单说,GridView 就是我们资源管理器平常见到的一个个文件的 icon 显示方式。 上面提及到了,GridView 的 Item 是来自ListAdapter 的,所以一般在Activity 的 onCreate 使用 GridView 的代码: @Override @Override public void onCreate(Bundle savedInstanceState) { 3. 4. 5. 6. 7. 8. 9. } super.onCreate(savedInstanceState); setContentView(R.layout.grid_2); GridView g = (GridView) findViewById(R.id.myGrid); g.setAdapter(new ImageAdapter(this)); 而 ImageAdapter 一 般 是 extends BaseAdapter 。 BaseAdapter 是 implements ListAdapte

文档评论(0)

1亿VIP精品文档

相关文档