The desired 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
First, the first control has been placed in another layout used, the normal display;
- After using tools-> XML Action-> validate checks to no avail.
- Re-establishment of files, one by one control, one by one write attribute, then absolutely do not care the original file.
- More careful because of this, it is desirable to look directly out
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.