Circular dependencies cannot exist in RelativeLayout

循环布局错误!!!

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
              android:id="@+id/drop_down_item"
              android:layout_width="match_parent"
              android:layout_height="match_parent"
              android:orientation="horizontal">
    <RelativeLayout android:layout_width="match_parent" android:layout_height="match_parent"
            >
        <TextView
                android:layout_alignLeft="@+id/drop_down_list_item_delete"
                android:layout_alignParentLeft="true"
                android:id="@+id/drop_down_list_item"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:text="test"
                android:textColor="@color/black"
                android:textSize="20sp">
        </TextView>

        <ImageButton
                android:layout_alignParentRight="true"
                android:layout_gravity="center"
                android:id="@+id/drop_down_list_item_delete"
                android:layout_width="50dp"
                android:layout_height="50dp"
                android:layout_toRightOf="@id/drop_down_list_item" // 这句话发生了循环布局。明明textviw 在button前 ,去掉就好了!!
                android:background="@drawable/drop_down_user_name_delete">
        </ImageButton>
    </RelativeLayout>


</LinearLayout>

posted @ 2015-07-31 20:05  Genji_  阅读(447)  评论(0编辑  收藏  举报