Я разрабатываю приложение для Android, которое поддерживает все размеры экрана, но когда дело доходит до длинных экранов, таких как 18: 9, оно дает мне странные результаты на экране.У меня есть следующие папки макетов «layout, layout-large, layout-xlarge, layout-normal» и устройства с соотношением сторон экрана 18: 9, которые используют настройки по умолчанию для папки «layout». У android может быть папка другого типа для размещения макетов этого типаXML-файлы работают только с экранами 18: 9.Или любой другой способ обработки длинных экранов.
Папки «Мой макет» имеют макет, макет большой, макет обычный, макет xlarge,
На этом изображении показано, как он переполняет мой текст вЭкран 18: 9.
Мой Activity_main.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:ads="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".MainActivity"
android:id="@+id/Main_layout"
>
<android.support.constraint.ConstraintLayout
android:layout_width="0dp"
android:layout_height="80dp"
android:background="@drawable/layout_bg"
android:layout_marginTop="2dp"
app:layout_constraintHorizontal_bias="0.0"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="parent"
android:id="@+id/Head_layout">
<ImageButton
android:id="@+id/Image_btn_home"
android:layout_width="80dp"
android:layout_height="80dp"
android:layout_marginBottom="8dp"
android:layout_marginLeft="32dp"
android:layout_marginTop="8dp"
android:background="@drawable/home"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintTop_toTopOf="parent"
android:layout_marginStart="32dp" />
<TextView
android:id="@+id/text_view_head_title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="8dp"
android:layout_marginLeft="47dp"
android:layout_marginStart="10dp"
android:layout_marginTop="20dp"
android:text="Hello Animals"
android:textColor="#000000"
android:textSize="45sp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintLeft_toRightOf="@+id/Image_btn_home"
app:layout_constraintRight_toLeftOf="@id/Image_btn_info"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintVertical_bias="0.0" />
<ImageButton
android:id="@+id/Image_btn_info"
android:layout_width="80dp"
android:layout_height="80dp"
android:layout_marginBottom="8dp"
android:layout_marginRight="32dp"
android:layout_marginTop="8dp"
android:background="@drawable/info"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="parent" />
</android.support.constraint.ConstraintLayout>
<android.support.constraint.ConstraintLayout
android:id="@+id/view_pager_container_layout"
android:layout_width="0dp"
android:layout_height="365dp"
android:background="@drawable/layout_bg"
app:layout_constraintHorizontal_bias="0.0"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toBottomOf="@+id/Head_layout">
<android.support.v4.view.ViewPager
android:id="@+id/View_pager"
android:layout_width="0dp"
android:layout_height="0dp"
android:layout_marginBottom="1dp"
android:layout_marginLeft="0dp"
android:layout_marginStart="0dp"
android:layout_marginTop="1dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintHorizontal_bias="1.0"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintVertical_bias="1.0">
</android.support.v4.view.ViewPager>
</android.support.constraint.ConstraintLayout>
<android.support.constraint.ConstraintLayout
android:id="@+id/constraintLayout"
android:background="@drawable/layout_bg"
android:layout_width="0dp"
android:layout_height="0dp"
app:layout_constraintBottom_toTopOf="@+id/Navigation_layout"
app:layout_constraintHorizontal_bias="1.0"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toBottomOf="@+id/view_pager_container_layout"
app:layout_constraintVertical_bias="0.0">
<com.google.android.gms.ads.AdView
android:id="@+id/adView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_centerHorizontal="true"
android:layout_marginBottom="8dp"
ads:adSize="SMART_BANNER"
ads:adUnitId="@string/banner_ad_unit_id"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="parent" />
</android.support.constraint.ConstraintLayout>
<android.support.constraint.ConstraintLayout
android:background="@drawable/layout_bg"
android:layout_width="0dp"
android:layout_height="70dp"
android:layout_marginTop="380dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintHorizontal_bias="1.0"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintVertical_bias="1.0"
android:id="@+id/Navigation_layout"
app:layout_constraintTop_toTopOf="@+id/Head_layout">
<ImageButton
android:id="@+id/Image_btn_left"
android:layout_width="50dp"
android:layout_height="50dp"
android:layout_marginBottom="8dp"
android:layout_marginLeft="32dp"
android:layout_marginTop="8dp"
android:background="@drawable/left"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintTop_toTopOf="parent"
android:layout_marginStart="32dp" />
<ImageButton
android:id="@+id/Image_btn_right"
android:layout_width="50dp"
android:layout_height="50dp"
android:layout_marginBottom="8dp"
android:layout_marginLeft="300dp"
android:layout_marginTop="8dp"
android:background="@drawable/right"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintTop_toTopOf="parent"
android:layout_marginEnd="32dp"
android:layout_marginRight="32dp"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintHorizontal_bias="1.0"
android:layout_marginStart="300dp" />
<ImageButton
android:id="@+id/Image_btn_play"
android:layout_width="50dp"
android:layout_height="50dp"
android:layout_marginBottom="8dp"
android:layout_marginEnd="0dp"
android:layout_marginLeft="0dp"
android:layout_marginRight="0dp"
android:layout_marginStart="0dp"
android:layout_marginTop="8dp"
android:background="@drawable/play"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintHorizontal_bias="0.5"
app:layout_constraintLeft_toRightOf="@+id/Image_btn_left"
app:layout_constraintRight_toLeftOf="@+id/Image_btn_right"
app:layout_constraintTop_toTopOf="parent" />
</android.support.constraint.ConstraintLayout>
</android.support.constraint.ConstraintLayout>
`