I have the following layout: I need to keep the button at the bottom of screen and it should be visible to the user. The rest of the layout should scroll.
Add android:layout_alignParentTop="true"
in your scrollView and delete android:layout_below="@+id/scrollView1"
in the bottomLinearLayout.
If you give both view each other android:layout_below id then this circular dependencies problem occur. for example
<TextView
android:id="@+id/tv"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Example Series"
android:layout_below="@+id/rv_qpl"/>
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/rv_qpl"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@+id/tv"/>
You cannot say the bottomLinearLayout is below scrollView1 then say scrollView1 is above bottomLinearLayout. Only do one, not both.
This is circular because it will try to position itself after it figures out where the other one is at... Which is waiting on the first one.
The problem is caused because there is a circular reference in the layout parameters.
For example, when view B is layout_below view A, view A can't reference view B anymore in it's below, alignRight etc. This can also exist between multiple views: A references B references C. In that scenario C can't reference A because of a circular dependency.
You Used :-
bottomLinearLayout is below scrollView1 And then you said that scrollView1 is above bottomLinearLayout
It dosen't work like that. Use one