我有一个ListView
对该行进行一些自定义布局(一张图像,然后使用两个TextView
在垂直方向上LinearLayout
,参见下面的代码)
我的问题是,当我动态更改文本大小时(在getView
的方法Adapter
),文字大小确实改变了,但是TextView
包裹它没有。
这是当我将大小设置为比默认值“更高”时它会执行的操作的图片(图片为 18)。尽管有大量看起来相似的线索或问题,但我还没有找到解决方案。
这是我的列表行的布局:
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="horizontal"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:padding="4dp">
<ImageView android:id="@+id/entries_list_item_icon"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginRight="6dp"/>
<LinearLayout android:orientation="vertical"
android:layout_width="0dip"
android:layout_weight="1"
android:layout_height="fill_parent">
<TextView android:id="@+id/entries_list_item_name"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="center_vertical"
android:textColor="@color/entries_list_item_name"/>
<TextView android:id="@+id/entries_list_item_summary"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:singleLine="true"
android:ellipsize="marquee"
android:textColor="@color/entries_list_item_summary"/>
</LinearLayout>
</LinearLayout>
我尝试将高度切换为0dip
正如其他地方所建议的,它没有改变任何事情。
EDIT The ListView
其本身是非常基本的:
<ListView android:id="@+id/entries_list"
android:layout_width="fill_parent"
android:layout_height="fill_parent"/>
我想你必须改变imageview
高度至fill_parent
。 Imageview 决定了布局的高度。
<ImageView
android:id="@+id/entries_list_item_icon"
android:layout_width="wrap_content"
android:layout_height="fill_parent"
android:layout_marginRight="6dp" />
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)