Reputation: 946
Hi I can't figure out why I'm getting a circular dependency with my xml layout? I know what it is but don't know what's causing it.
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/scroll_frame"
android:layout_width="match_parent"
android:layout_height="match_parent" >
<RelativeLayout
android:id="@+id/more_info"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/transparent_black" >
<Button
android:id="@+id/start_test"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_above="@+id/top_content"
android:layout_marginBottom="30dp"
android:layout_marginLeft="40dp"
android:layout_marginRight="40dp"
android:layout_marginTop="10dp"
android:onClick="onClickHandler"
android:text="@string/start_test" />
<WebView
android:id="@+id/top_content"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@+id/start_test" />
</RelativeLayout>
<WebView
android:id="@+id/bottom_content"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@+id/more_info"
android:layout_alignParentBottom="true" />
Can Anyone help with this issue?
Thanks
Upvotes: 0
Views: 63
Reputation: 4306
You are using
android:layout_above="@+id/top_content"
in Button and,
android:layout_below="@+id/start_test"
in WebView. Use only one.
Upvotes: 2
Reputation: 83008
You are writing android:layout_above="@+id/top_content"
into Button
and android:layout_below="@+id/start_test"
into WebView
. This is creating circular dependency for RelativeLayout.
Use either android:layout_above="@+id/top_content"
or android:layout_below="@+id/start_test"
So either use
<RelativeLayout
android:id="@+id/more_info"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/transparent_black" >
<Button
....
android:layout_above="@+id/top_content"
.... />
<WebView
android:id="@+id/top_content"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
</RelativeLayout>
Or
<RelativeLayout
android:id="@+id/more_info"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/transparent_black" >
<Button
android:id="@+id/start_test"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="30dp"
android:layout_marginLeft="40dp"
android:layout_marginRight="40dp"
android:layout_marginTop="10dp"
android:onClick="onClickHandler"
android:text="@string/start_test" />
<WebView
android:id="@+id/top_content"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@+id/start_test" />
</RelativeLayout>
Upvotes: 3