gpt4 book ai didi

android - 如何包装文本android listview

转载 作者:搜寻专家 更新时间:2023-11-01 08:12:51 26 4
gpt4 key购买 nike

http://img804.imageshack.us/img804/9858/howtowrapmiddletext.png

基本上我有一个分为三个部分的 ListView 。左边是图片,右边是按钮,中间是我要包裹的文字。看看我的照片就知道我在说什么

这是我的 xml 布局:

<?xml version="1.0" encoding="utf-8"?>

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent">

<ImageView
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:src="@drawable/ic_tab_drink_selected"
android:id="@+id/img1"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:padding="10dp"
android:textSize="16sp"
android:id="@+id/text1"/>
<Button
android:id="@+id/btn1"
android:layout_width="60dp"
android:layout_height="60dp"
/>
</LinearLayout>

最佳答案

好的,这里有一些你可以尝试的事情:

1) 你的线性布局中有 android:orientation="horizo​​ntal" 吗?

2) 为您的 EditText 设置 android:inputType="textMultiLine"

如果不行的话3) 对于您的 EditText,设置 android:layout_width="0dip"android:layout_weight="1"

关于android - 如何包装文本android listview,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8017485/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com