设置了上下左右约束,加个marginend不起作用,现在才发现要把宽设置为0dp.就可以了。(适应约束布局,出去margin之外)
<androidx.constraintlayout.widget.ConstraintLayout android:id="@+id/zan_layout" android:layout_marginTop="@dimen/space_to_border" android:layout_below="@+id/indicator_layout" android:layout_width="match_parent" android:layout_height="wrap_content">
<TextView android:id="@+id/textView4" android:layout_width="0dp" android:layout_height="wrap_content" android:layout_marginStart="8dp" android:layout_marginTop="8dp"
android:layout_marginEnd="32dp"
android:text="TextViewTextViewTextViewTextViewTextViewTextViewTextView" app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.0"
app:layout_constraintStart_toEndOf="@+id/textView3"
app:layout_constraintTop_toTopOf="parent" />
</androidx.constraintlayout.widget.ConstraintLayout>
网友评论