ScrollView 和 orientation with weightsum
ScrollView and orientation with weightsum
<ScrollView
android:id="@+id/scrollView1"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:weightSum="100"
android:orientation="vertical" >
<TextView
android:id="@+id/te"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="50"
android:text="TextView1" />
<TextView
android:id="@+id/te2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="50"
android:text="TextView2" />
</LinearLayout>
</ScrollView>
问题是我想要并排的 TextView 和垂直的滚动视图 textviews.But 它不是那样工作的,当我将方向设置为垂直时,textview 变成一个在另一个下面但是滚动视图有效 well.I 认为你了解我的意思 saying.Pls 帮我找到解决方案。
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:weightSum="100"
android:orientation="horizontal" >
<TextView
android:id="@+id/te"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="50"
android:text="TextView1" />
<TextView
android:id="@+id/te2"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="50"
android:text="TextView2" />
<ScrollView
android:id="@+id/scrollView1"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:weightSum="100"
android:orientation="vertical" >
<TextView
android:id="@+id/te"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="50"
android:text="TextView1" />
<TextView
android:id="@+id/te2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="50"
android:text="TextView2" />
</LinearLayout>
</ScrollView>
问题是我想要并排的 TextView 和垂直的滚动视图 textviews.But 它不是那样工作的,当我将方向设置为垂直时,textview 变成一个在另一个下面但是滚动视图有效 well.I 认为你了解我的意思 saying.Pls 帮我找到解决方案。
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:weightSum="100"
android:orientation="horizontal" >
<TextView
android:id="@+id/te"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="50"
android:text="TextView1" />
<TextView
android:id="@+id/te2"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="50"
android:text="TextView2" />