4
나는 그 안에 몇 개의 뷰가있는 ConstraintLayout
을 가지고 있으며, 어떤 이유에서든 내 textview
이 문장의 끝 부분에서 잘 리게됩니다. textview
은 왼쪽과 위쪽으로 제한됩니다. tv_product_description
textview
입니다.ConstraintLayout은 텍스트 뷰에서 텍스트를 자릅니다.
<android.support.constraint.ConstraintLayout
android:id="@+id/ll_product_holder"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="16dp"
android:layout_marginRight="16dp"
android:layout_marginTop="16dp"
android:background="@drawable/drawable_border"
android:orientation="vertical">
<com.facebook.drawee.view.SimpleDraweeView
android:id="@+id/iv_product_image"
android:layout_width="100dp"
android:layout_height="100dp"
android:layout_marginBottom="8dp"
android:layout_marginLeft="9dp"
android:layout_marginStart="9dp"
android:layout_marginTop="13dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintTop_toBottomOf="@+id/price_holder"
fresco:actualImageScaleType="centerCrop"
fresco:placeholderImage="@drawable/placeholder2"/>
<TextView
android:id="@+id/tv_product_id"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="9dp"
android:layout_marginStart="9dp"
android:layout_marginTop="13dp"
android:text="@{historyItem.productId}"
app:layout_constraintLeft_toRightOf="@+id/iv_product_image"
app:layout_constraintTop_toBottomOf="@+id/price_holder"/>
<TextView
android:id="@+id/tv_product_description"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="9dp"
android:layout_marginStart="9dp"
android:ellipsize="end"
android:maxLines="2"
android:text="@{historyItem.productDescription}"
app:layout_constraintLeft_toRightOf="@+id/iv_product_image"
app:layout_constraintTop_toBottomOf="@+id/tv_product_id"/>
</android.support.constraint.ConstraintLayout>
'constraintRight'를 추가하려고 시도했지만'textview '가 모두 엉망이되어 버린 것처럼 보입니다. 왼쪽 제약이 무시되어 여전히 잘린 것처럼 보입니다. – Esteban
나는 이미 내 컴퓨터에서 테스트를 마쳤지 만 부모 레이아웃에 속하지 않은 몇 가지 제약 조건을 이미 부여했다. –
'android : layout_width = "0dp"'당신을 위해 잘되기를 바랍니다. –