Android Relative Layout circular dependencies error

后端 未结 3 912
时光取名叫无心
时光取名叫无心 2020-12-06 11:26

Hi im trying to create a custom layout but i\'m struggling to get it to work properly i\'m getting an error \"circluar dependencies cannot exist in Relative layout\"

3条回答
  •  生来不讨喜
    2020-12-06 11:45

    Well, you have a few problems here:

    1. TextView04 declares android:layout_below="@+id/HomeScore" and android:layout_centerVertical="true", which conflict

    2. AwayTeam declares android:layout_alignBaseline="@+id/TextView04" and android:layout_alignBottom="@+id/TextView04", which conflict

    3. HomeTeam declares android:layout_alignBaseline="@+id/TextView04" and android:layout_alignBottom="@+id/TextView04", which conflict

    4. AwayScore declares android:layout_alignBaseline="@+id/TextView04" and android:layout_alignBottom="@+id/TextView04", which conflict

    As Samir points out, at least one of your circular dependencies is between TextView04 and HomeScore. TextView04 says it is to be below HomeScore, and HomeScore says its bottom is aligned with the bottom of TextView04. However, some of the other ones I note above may also create circular dependencies. Ensure that two widgets do not try to constrain on each other on the same axis (as in TextView04 and HomeScore).

提交回复
热议问题