报的错是这样的java.lang.IllegalStateException: Circular dependencies cannot exist in RelativeLayout
说我的相对布局循环依赖了,看了一下布局确实有问题
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="@dimen/m17">
<TextView
android:id="@+id/tv_title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginEnd="12dp"
android:layout_marginStart="@dimen/m11"
android:layout_toStartOf="@+id/tv_State" />
<TextView
android:id="@+id/tv_State"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginEnd="16dp"
android:layout_toEndOf="@+id/tv_title" />
</RelativeLayout>
原因就是我第一个控件 android:layout_toStartOf="@+id/tv_State",但是我第二个控件还android:layout_toEndOf="@+id/tv_title",只需要在一个控件加就可以了