私はConstraintLayoutを使用しています。Android:制約レイアウト - 調整できません比率のサイズ変更後の画像ビューの表示範囲
私は16:9になりたい画像ビューを持っています。このImage Viewの下に、テキストビューを配置しようとしています。
イメージビューがなくなると、テキストビューが上に移動することが予想されます。しかし、これは起こっていない。
いくつかのいずれかは、私のXMLレイアウトに問題を把握してみてくださいでした:
<?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:background="@color/dark_background"
android:layout_width="0dp"
android:layout_height="0dp"
android:padding="15dp"
tools:layout_width="300dp"
tools:layout_height="300dp"
>
<ImageView
android:id="@+id/image"
android:layout_width="wrap_content"
android:layout_height="0dp"
android:adjustViewBounds="true"
android:scaleType="centerInside"
android:src="@drawable/logo"
app:layout_constraintDimensionRatio="W,16:9"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintHorizontal_bias="0.5"
app:layout_constraintVertical_bias="1.0" />
<TextView
android:id="@+id/title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toBottomOf="@id/image"
android:ellipsize="marquee"
android:maxLines="4"
android:textSize="28sp"
android:textColor="#000000"
android:text="The is the test that does not seem to work"
android:layout_marginTop="12.41dp"
app:layout_goneMarginTop="0dp"/>
</android.support.constraint.ConstraintLayout>
誰かよろしいですか? – Sunny