I want activity in which part one is scrollable and part two remains still.
Asked
Active
Viewed 140 times
-3

Vadim Kotov
- 8,084
- 8
- 48
- 62
-
You can use scrollview with your preffered size – Warrocker May 22 '18 at 19:12
2 Answers
0
You can use a vertical Linear layout as the parent with two children.
Child 1 - Scrollview with weight 1
Child 2 - A view with height as wrap_content

Rishabh Jain
- 297
- 2
- 13
0
use something along the lines of this code
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<ScrollView
android:layout_width="match_parent"
android:layout_height="0"
android:layout_weight="3"
android:background="#abc">
<!--some content for scrolling here-->
</ScrollView>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="0"
android:layout_weight="1"
android:background="#cba">
<!--put other component here-->
</LinearLayout>
</LinearLayout>
here the ScrollView has a layout weight of 3 vs 1 for the LinearLayout so it will take 75% of height and 25% will be given to LinearLayout

Doc
- 10,831
- 3
- 39
- 63