Reputation: 425
<ScrollView
android:id="@+id/sv_chat"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_above="@+id/layout_bottom"
android:background="#ffffffff" >
<LinearLayout
android:id="@+id/layout_chatrecord"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_gravity="bottom"
android:orientation="vertical" >
</LinearLayout>
</ScrollView>
If I add android:layout_gravity="bottom"
in the LinearLayout
, the ScrollView
can't work.
When I put view in LinearLayout
all the time,the view will appear from the bottom up which is I want.While the result is ScrollView
can't work,the view put first can't be seen.How to solve it?
Upvotes: 0
Views: 1112
Reputation: 5591
Try this..
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/ScrollView01" android:layout_width="fill_parent"
android:layout_height="fill_parent">
<LinearLayout
android:orientation="vertical" android:layout_width="fill_parent"
android:layout_height="fill_parent" android:scrollbars="vertical"
android:scrollbarAlwaysDrawVerticalTrack="true">
</LinearLayout>
</ScrollView>
Upvotes: 1