【发布时间】:2019-11-14 06:55:48
【问题描述】:
我正在设计这个XML 文件:
<android.support.constraint.ConstraintLayout
android:id="@+id/title_layout"
android:layout_width="0dp"
android:layout_height="wrap_content"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent"
android:background="#00C7C7">
<ImageView
android:id="@+id/imageView"
android:layout_width="80dp"
android:layout_height="80dp"
app:srcCompat="@drawable/icon_n"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent"
android:layout_marginTop="16dp"
/>
<TextView
android:id="@+id/list_title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:layout_constraintTop_toBottomOf="@id/imageView"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent"
android:text="@string/all"
android:fontFamily="@font/koohinoor_bold"
android:textSize="30sp"
android:textColor="#FFFFFF"
/>
<TextView
android:id="@+id/description"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:layout_constraintTop_toBottomOf="@id/list_title"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintBottom_toBottomOf="parent"
android:text="@string/all_alphabetic_order"
android:fontFamily="@font/koohinoor_bold"
android:textSize="13sp"
android:textColor="#3A3939"
android:layout_marginBottom="16dp"
/>
</android.support.constraint.ConstraintLayout>
TextView 位于ImageView 下。另一个TextView 位于第一个提到的TextView 之下。我预计TextViews 和ImagView 之间没有边距,但还有多余的边距......
可能是什么问题?有什么解决办法?
注释:
我使用的是波斯字体。
在XML 预览中,没有观察到问题。此问题在运行时出现。
【问题讨论】:
-
请将 app:layout_constraintVertical_bias="0" 添加到您的文本视图描述中
-
亲爱的@ManthanPatel,不幸的是,它没有用。如果可能,请提出任何其他解决方案。 . .
-
你能分享截图什么是输出视图与这个代码
标签: android android-studio fonts margins