I have 2 views one is a scroll view and the other is a LinearLayout. I want the LinearLayout to be a fixed size, i have it about 80dp. I want this layout to be on the right hand side of my screen the whole time. The rest of the space i want my Scroll View to take up. Here is what my code looks like.
<LinearLayout
android:id="@+id/widget4327"
android:layout_below="@+id/line"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="#F4F5DC">
<ScrollView
android:id="@+id/ScrollView01"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="left"
android:layout_below="@+id/line">
</ScrollView>
<LinearLayout
android:id="@+id/linearL2"
android:background="#EEEFE0"
android:layout_gravity="right"
android:layout_height="fill_parent"
android:layout_width="80dp"
android:orientation="vertical"
android:gravity="left"
android:layout_toRightOf="@id/ScrollView01">
</LinearLayout>
</LinearLayout>
I thought the gravity开发者_如何学运维 would take care of this but i cant seem to get it working. Any ideas?
If you use a RelativeLayout
then you can set the alignToParentLeft
to true
精彩评论