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>
ご希望のレイアウトがどのように見えるかを説明してもらえますか? –
原文テキストレンダリングで更新されました。本質的に日付は円のイメージとテキストビューの両方の上にあり、その間に空白があります。 –