0
我在TextView
的另一个TextView
的ConstraintLayout
的位置上发现问题,但它没有重叠底部元素。我已经尝试将paddingBottom
和marginBottom
的值添加到TextView
,但它似乎没有预算。任何见解?在ConstraintLayout中合并位置TextView
预期渲染
+---------------------------------+
| 7/12/2017 |
|_______ ________________ |
|| | | | |
||Image| | Text Bubble | |
||_____| |______________| |
|_________________________________|
实际呈现
布局
<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:paddingTop="8dp">
<CustomComponent.CircleImageView
android:id="@+id/rec_image_message_profile"
android:layout_width="36dp"
android:layout_height="36dp"
app:layout_constraintTop_toTopOf="parent"
android:layout_marginLeft="8dp"
app:layout_constraintLeft_toLeftOf="parent" />
<TextView
android:id="@+id/rec_message_body"
android:background="@drawable/message_bubble_gray"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:maxWidth="240dp"
android:padding="8dp"
android:textColor="#39454C"
android:layout_marginTop="4dp"
app:layout_constraintLeft_toRightOf="@+id/rec_image_message_profile"
android:layout_marginLeft="8dp" />
<TextView
android:id="@+id/rec_message_time"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textSize="10sp"
app:layout_constraintTop_toTopOf="@+id/rec_message_body"
android:layout_marginLeft="8dp"
android:gravity="center"
android:paddingBottom="20dp"/>
</android.support.constraint.ConstraintLayout>
你能解释一下你想要的布局应该是什么样子? –
用原始文本渲染更新。基本上,日期应该在圆形图像和文本视图之上,并且中间有空格。 –