[ACCEPTED]-Circular dependencies cannot exist in RelativeLayout, android?-android-relativelayout

Accepted answer
Score: 83

The problem is caused because there is a 11 circular reference in the layout parameters.

For 10 example, when view B is layout_below view 9 A, view A can't reference view B anymore 8 in it's below, alignRight etc. This can 7 also exist between multiple views: A references 6 B references C. In that scenario C can't 5 reference A because of a circular dependency.

You 4 Used :-

bottomLinearLayout is below scrollView1 And 3 then you said that scrollView1 is above 2 bottomLinearLayout

It dosen't work like that. Use 1 one

Score: 7

You cannot say the bottomLinearLayout is 6 below scrollView1 then say scrollView1 is 5 above bottomLinearLayout. Only do one, not 4 both.

This is circular because it will try 3 to position itself after it figures out 2 where the other one is at... Which is waiting 1 on the first one.

Score: 1

Add android:layout_alignParentTop="true" in your scrollView and delete android:layout_below="@+id/scrollView1" in the 1 bottomLinearLayout.

Score: 0

If you give both view each other android:layout_below id then 1 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"/>

More Related questions