本文转自:http://www.iteye.com/topic/540423

 

ListView是比较常用的控件,但一直都觉得创建ListView步骤有点繁琐,故在此总结一下,方便查阅。

程序效果是实现一个ListView,ListView里面有标题,内容和图片,并加入点击和长按响应。

 

[转]Android ListView常用用法

 

 

[转]Android ListView常用用法

 

首先在xml里面定义一个ListView

 

 

Xml代码 [转]Android ListView常用用法 [转]Android ListView常用用法[转]Android ListView常用用法
  1. <?xml version="1.0" encoding="utf-8"?>  
  2. <LinearLayout    
  3.     android:id="@+id/LinearLayout01"    
  4.     android:layout_width="fill_parent"    
  5.     android:layout_height="fill_parent"    
  6.     xmlns:android="http://schemas.android.com/apk/res/android">  
  7. <ListView android:layout_width="wrap_content"    
  8.           android:layout_height="wrap_content"    
  9.           android:id="@+id/ListView01"  
  10.           />  
  11. </LinearLayout>  

 

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-08-30
  • 2021-12-02
  • 2021-11-30
  • 2021-11-30
  • 2021-11-02
猜你喜欢
  • 2021-08-04
  • 2021-11-20
  • 2021-11-02
  • 2022-12-23
  • 2021-11-02
  • 2021-11-20
  • 2021-11-02
相关资源
相似解决方案