2017-12-17 7 views
2

私のレイアウトでは、最後のビュー(青いテキスト)が下の画像のように切り取られています。ConstraintLayout最後のビューがクロップされています

enter image description here

使用されて

<?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" 
    android:layout_width="match_parent" 
    android:layout_height="wrap_content"> 

    <ImageView 
     android:id="@+id/ivIcon" 
     android:layout_width="24dp" 
     android:layout_height="24dp" 
     android:layout_marginEnd="10dp" 
     android:layout_marginTop="10dp" 
     android:background="@color/blue" 
     app:layout_constraintEnd_toEndOf="parent" 
     app:layout_constraintTop_toTopOf="parent"/> 

    <TextView 
     android:id="@+id/tvMain" 
     style="@style/ActorTextMainOne" 
     android:layout_width="wrap_content" 
     android:layout_height="wrap_content" 
     android:layout_marginStart="20dp" 
     android:layout_marginTop="28dp" 
     android:text="28" 
     app:layout_constraintStart_toStartOf="parent" 
     app:layout_constraintTop_toTopOf="parent"/> 

    <TextView 
     android:id="@+id/tvSecondaryOne" 
     style="@style/ActorTextSecondary" 
     android:layout_width="0dp" 
     android:layout_height="wrap_content" 
     android:layout_marginEnd="8dp" 
     android:layout_marginStart="4dp" 
     android:text="Jun" 
     app:layout_constraintBottom_toTopOf="@+id/tvSecondaryTwo" 
     app:layout_constraintEnd_toEndOf="parent" 
     app:layout_constraintStart_toEndOf="@+id/tvMain"/> 

    <TextView 
     android:id="@+id/tvSecondaryTwo" 
     style="@style/ActorTextSecondary" 
     android:layout_width="0dp" 
     android:layout_height="wrap_content" 
     android:layout_marginBottom="12dp" 
     android:layout_marginEnd="8dp" 
     android:layout_marginStart="4dp" 
     android:text="2017" 
     app:layout_constraintBottom_toBottomOf="@+id/tvMain" 
     app:layout_constraintEnd_toEndOf="parent" 
     app:layout_constraintStart_toEndOf="@+id/tvMain"/> 

    <TextView 
     android:id="@+id/tvDescription" 
     style="@style/ActorTextDescription" 
     android:layout_width="0dp" 
     android:layout_height="wrap_content" 
     android:layout_marginEnd="8dp" 
     android:layout_marginTop="4dp" 
     android:text="@string/arrival_date" 
     app:layout_constraintEnd_toEndOf="parent" 
     app:layout_constraintStart_toStartOf="@+id/tvMain" 
     app:layout_constraintTop_toBottomOf="@+id/tvSecondaryTwo"/> 

</android.support.constraint.ConstraintLayout> 

ConstraintLayoutのバージョンを次のように私は私のConstraintLayoutを設定している私は、私はここで何かを明らかに行方不明ですが、私はそれを把握することができないと思う1.0.2

ですでる。 ConstraintLayoutの高さをwrap_contentに保ちながら、下の青色のテキストを完全に見えるようにするにはどうすればよいですか?

答えて

1

にid tvDescription

でTextViewのため

app:layout_constraintTop_toBottomOf="@+id/tvMain" 

app:layout_constraintTop_toBottomOf="@+id/tvSecondaryTwo" 

を変更してみてくださいこれは、ID tvDescriptionとのTextViewがID tvMainとTextViewに下回るようになります。

+0

これは実際に青いテキスト全体を示しています。しかし、それはtvMainによって生じる追加のボトムスペースを克服するためにtvSecondaryTwoに対して制約されていました。申し訳ありませんが、私は私の元の質問でこれを言及しなかった。あなたはtvSecondaryTwoに対して拘束されているときになぜ動作していないのか説明してください。 –

+0

"tvMainによって引き起こされる余分なスペース"については理解していませんか? – Raghunandan

+0

大きいテキストビューは、追加の上部と下部のパディングを引き起こしました。ここに尋ねられたのと同じ問題https://stackoverflow.com/questions/6593885/how-to-remove-the-top-and-bottom-space-on-textview-of-android –

関連する問題