我有这样的布局:Android - 为什么两个TextView元素并排排列,而不是下一个?
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="wrap_content"
android:layout_height="wrap_content" >
<TextView
android:id="@+id/solution_title"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="Label1"
/>
<TextView
android:id="@+id/solution_description"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="Label2"
/>
<ListView
android:id="@android:id/list"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@+id/label"
android:textSize="20px" >
</ListView>
</LinearLayout>
我结合了一个ListView 2个TextView的元素。出于某种原因,TextView项目呈现为彼此相邻,而不是一个在另一个之下。为什么会发生?我如何让他们排列在另一个之下?
谢谢!
尝试在您的LinearLayout中添加此android:orientation =“vertical” – Shubhayu 2012-03-20 13:24:54
您的适配器问题是否得到解决? – Shubhayu 2012-03-20 13:25:29