Android列表视图布局
我在android应用程序中使用自定义列表项实现了listview。我想要实现的是,当设备的屏幕尺寸很小时,列表项的组件/内容应该向下移动,增加列表项的高度,类似于MSWord中的换行文本。这在我的应用程序中目前没有发生。在自定义listitem布局中可以做些什么来实现相同的效果 以下是我的listview行项目的当前布局:Android列表视图布局,android,android-layout,android-listview,Android,Android Layout,Android Listview,我在android应用程序中使用自定义列表项实现了listview。我想要实现的是,当设备的屏幕尺寸很小时,列表项的组件/内容应该向下移动,增加列表项的高度,类似于MSWord中的换行文本。这在我的应用程序中目前没有发生。在自定义listitem布局中可以做些什么来实现相同的效果 以下是我的listview行项目的当前布局: <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<de.hdodenhof.circleimageview.CircleImageView
android:id="@+id/shared_mood_item_image"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/default_profile_pic"
android:layout_centerVertical="true"
android:layout_margin="@dimen/margin"/>
<LinearLayout
android:id="@+id/linear_l_1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_toRightOf="@+id/shared_mood_item_image"
android:layout_toEndOf="@+id/shared_mood_item_image"
android:layout_centerVertical="true"
android:orientation="vertical">
<TextView
android:id="@+id/txt_1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"/>
<TextView
android:id="@+id/txt_2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"/>
</LinearLayout>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_alignParentEnd="true"
android:layout_centerVertical="true"
android:gravity="center"
android:layout_toRightOf="@+id/linear_l_1"
android:layout_toEndOf="@+id/linear_l_1"
android:orientation="vertical">
<TextView
android:id="@+id/txt_3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"/>
<Switch
android:id="@+id/switch_1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:focusable="false"/>
</LinearLayout>
提前谢谢。您应该在线性布局婴儿车中使用“匹配父对象”作为宽度,而不是包装内容
更新
您还应该在所有其他视图中使用match\u parent作为宽度参数。只需在值(dimens.xml)中定义特定的文本大小,并为不同的设备创建不同的布局。。。。它应该对你有用。谢谢你的建议,朋友。但我想我有问题了。我没有在不同的屏幕上使用不同的图像。较小的图像使我的listview看起来不错。这不是我问题的答案,但它解决了我的问题。