listview item的高度

来源:互联网 发布:户口本在线制作软件 编辑:程序博客网 时间:2024/09/21 09:23
在item的layout文件中,用android:layout_height设置item的高度。
运行,高度设置无效。


解决办法:

给item设定minHeight,即可.

---------------------------------------

[html] view plain copy
print?在CODE上查看代码片派生到我的代码片
  1. <?xml version="1.0" encoding="utf-8"?>  
  2. <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"  
  3.     android:orientation="horizontal"  
  4.     android:layout_width="fill_parent"  
  5.     android:layout_height="50dip"  
  6.     android:minHeight="100dp"  
  7.     >  
  8.     <TextView  
  9.         android:id="@+id/tv"  
  10.         android:layout_width="fill_parent"   
  11.         android:layout_height="20dp"   
  12.         android:text="@string/hello"  
  13.         />  
  14. </LinearLayout>  

0 0
原创粉丝点击