私は制約レイアウトをインクルードタグとして追加する主なレイアウトを持っています。 私の主なレイアウトです。メインレイアウトに制約レイアウトを適切に含めるにはどうすればいいですか?
<android.support.constraint.ConstraintLayout
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent">
<ImageView
android:id="@+id/logo1"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:adjustViewBounds="true"
android:contentDescription="@null"
android:paddingTop="@dimen/multi_screen_medium_padding"
android:paddingStart="@dimen/multi_screen_medium_padding"
android:paddingEnd="@dimen/multi_screen_medium_padding"
android:src="@drawable/logo1"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintHorizontal_bias="0.0"
android:layout_marginLeft="16dp"
android:layout_marginTop="8dp"
android:layout_marginRight="16dp"/>
<ImageView
android:id="@+id/logo2"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:contentDescription="@null"
android:src="@drawable/logo2"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toBottomOf="@+id/logo1"
android:layout_marginTop="8dp"
app:layout_constraintDimensionRatio="w,1:1"/>
</android.support.constraint.ConstraintLayout>
私の要件以下のように、2つのimageViewsで構成されてい
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<TextView
android:id="@+id/text1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/text1"
android:textAlignment="center"
android:textColor="@color/app_theme_primary"
android:textSize="@dimen/large_header_text_size" />
<TextView
android:id="@+id/version_number"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/version_number"
android:textAlignment="center"
android:textColor="@color/common_main_background"
android:textSize="@dimen/secondary_text_size"/>
<TextView
android:id="@+id/develop_text"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingTop="@dimen/padding_10dp"
android:gravity="center"
android:text="@string/developed_text"
android:textColor="@color/common_main_background"
android:textStyle="bold" />
<include layout="@layout/common_layout"/>
<TextView
android:id="@+id/trademarks"
android:layout_height="wrap_content"
android:layout_width="match_parent"
android:text="@string/trademarks"
android:textAlignment="center"
android:paddingTop="@dimen/multi_screen_small_padding"
android:textColor="@color/common_main_background"
android:textSize="@dimen/secondary_text_size" />
</LinearLayout>
私の制約レイアウトが
1.Constraintレイアウトがメインレイアウトに適切に装着されなければならないが、ここで私が直面する問題は、最後のTextViewです(IDです:商標)が画面上に表示されない。
2. 2番目の画像(logo2)は画面サイズごとに適切に調整する必要があります。
どうすればいいですか?前もって感謝します。
同じ画像の異なる解像度を使用する必要があります。 [this](https://stackoverflow.com/questions/37207443/how-to-put-single-image-for-different-screen-size)を読んでください。 – gbruscatto
ソースコードのチャンクを適切にフォーマットするには、Ctrl + KまたはCmd + Kを使用する必要があります。 –
この縫い目は複雑です。だから最善の解決策は何gbruscattoを行うか、パーセンテージでそれを行うことです:https://stackoverflow.com/questions/37318228/how-to-make-constraintlayoutwork-with-percentage-values –