我是新手才接触android,我想改变listview 背景颜色和大小。
我不知道该怎么做。求教

解决方案 »

  1.   

    在你定义listview 的xml中找到那个listview 然后改变它的android:background属性来设置背景,改变他的 android:layout_height and android:layout_width 来控制大小。
      

  2.   


      <ListView 
          android:layout_height="wrap_content" 
          android:id="@+id/listView1" 
          android:layout_width="match_parent"
          android:background="@layout/list_corner_1"
          android:layout_height="20px"
          android:layout_width="30px"
          >
          </ListView>
    要报错啊
      

  3.   

      1 你的layout_width和layout_height属性重复了,肯定报错
      2 你的背景是@layout,应该也会报错,编译时可能不会,但是运行时就会
      

  4.   

    <ListView 
          android:layout_height="wrap_content" -->这个删掉
          android:id="@+id/listView1" 
          android:layout_width="match_parent" -->这个删掉
          android:background="@layout/list_corner_1" -->这个改成@drawable/你的图片名
          android:layout_height="20px"  -->最好写20dip 
          android:layout_width="30px"   -->30dip
          >
          </ListView>
    看你新手,全给你改下吧  
      

  5.   

    android:background="@layout/list_corner_1"
    背景这样写是可以,就是不知道你的list_corner_1.xml资源文件是怎么写的。
      

  6.   

    网上搜个listview代码N多
      

  7.   

    api里有吧 做ui不看api 光看demo 收效不大啊