问题描述
当在ConstraintLayout
限制TextView
的范围时,TextView
中的文字缺失一部分.
<?xml version="1.0" encoding="utf-8"?>
<android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/white">
<android.support.constraint.Guideline
android:id="@+id/guide"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical"
app:layout_constraintGuide_percent="0.5" />
<TextView
android:id="@+id/tvOffice"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_marginLeft="@dimen/activity_margin_little"
android:padding="@dimen/activity_margin"
android:textColor="@color/nxt_515151"
android:textSize="@dimen/common_text_size"
app:layout_constraintEnd_toEndOf="@id/guide"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
tools:text="机构名称\你说地方水电费所说的发挥" />
</android.support.constraint.ConstraintLayout>
解决
- 修改
TextView
的高度属性为wrap_content
<TextView
android:layout_height="wrap_content"`
.../>