Wrong title: ConstraintLayout not display properly

The desired effect:
The desired effect

actual effect:
actual effect

The reason: because the constraint property of a control file wrong

This property is app:layout_constraintLeft_toLeftOf="@id/oa_setting_group_tv_add"
written to the left of his own.

<TextView
    android:id="@+id/oa_setting_group_tv_add"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_marginLeft="@dimen/dp_10"
    android:text="新增考勤组"
    android:textColor="@color/oa_color"
    android:textSize="@dimen/sp_16"
    app:layout_constraintBottom_toBottomOf="@id/oa_setting_group_background_add"
    app:layout_constraintLeft_toLeftOf="@id/oa_setting_group_tv_add"
    app:layout_constraintTop_toTopOf="@id/oa_setting_group_background_add" />
 

How to tell: one by one investigation

  1. First, the first control has been placed in another layout used, the normal display;

  2. After using tools-> XML Action-> validate checks to no avail.
  3. Re-establishment of files, one by one control, one by one write attribute, then absolutely do not care the original file.
  4. More careful because of this, it is desirable to look directly out
  5. Control two documents, we found a property was wrong! ! !

How to fix: change it back

Summary: Live Preview!

Negligence ConstraintLayout control is a loser.
Open Preview, pay attention to the real-time effects. Most times too anxious to have a control a preview. Otherwise hard to find.

Guess you like

Origin www.cnblogs.com/skymxc/p/11407227.html