android解决无法设定listview的item高度(设置行高)
16lz
2022-01-28
原地址:http://blog.csdn.net/tianshuguang/article/details/38395979
在item的layout文件中,用android:layout_height设置item的高度。
运行,高度设置无效。
解决办法:
给item设定minHeight,即可.
---------------------------------------
[html] view plain copy
- <?xml version="1.0" encoding="utf-8"?>
- <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
- android:orientation="horizontal"
- android:layout_width="fill_parent"
- android:layout_height="50dip"
- android:minHeight="?android:attr/listPreferredItemHeight"
- >
- <TextView
- android:id="@+id/tv"
- android:layout_width="fill_parent"
- android:layout_height="20dp"
- android:text="@string/hello"
- />
- LinearLayout>
更多相关文章
- Android(安卓)Tab 控件详解及实例
- Android中的DownloadManager
- 基于Android(安卓)tess-two工程的数字识别
- android spinner自动弹出列表,设置title,TtextView不换行自动截取
- Android(安卓)BitmapFactory.Options 介绍
- Android(安卓)的网络编程
- Eclipse下Android-SDK-1.5模拟器启动设置
- Android(安卓)程序获取、设置铃声、音量、静音、扬声器
- android 4中新增的日历处理相关API