【发布时间】:2017-05-02 12:57:54
【问题描述】:
我有一个ConstraintLayout,其中有几个视图,出于某种原因,我的textview 在句尾被截断。 textview 被限制在左侧和顶部。是tv_product_descriptiontextview。
<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>
【问题讨论】:
标签: android xml android-constraintlayout