0

Нужно, чтобы ImageView был в нижнем слое и чтобы он не закрывал другие элементы

1
  • Сделайте корневым FrameLayout и поместите первым элементом `ImageView
    – Jarvis_J
    30 июн 2018 в 17:49

2 ответа 2

2

Расположи его под всеми элементами

<ImageView
    android:layout_width="match_parent"
    android:layout_height="match_parent" />

<TextView
    android:id="@+id/textView"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:text="TEXT" />

<Button
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    app:layout_constraintEnd_toEndOf="parent"
    app:layout_constraintStart_toEndOf="@+id/textView" />

Как то так..

0

Используйте RelativeLayout.

<RelativeLayout
    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="match_parent">

    <ImageView
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:scaleType="centerCrop"
        app:srcCompat="@drawable/background" />
</RelativeLayout>

Учтите, что если вы хотите сделать так во всём приложении (или в большóй его части), делайте это через стиль (файл styles.xml):

<style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">
    <item name="colorPrimary">@color/colorPrimary</item>
    <item name="colorPrimaryDark">@color/colorPrimaryDark</item>
    <item name="colorAccent">@color/colorAccent</item>
    <item name="android:windowBackground">@drawable/background</item>
</style>

Ваш ответ

By clicking “Отправить ответ”, you agree to our terms of service and acknowledge you have read our privacy policy.

Всё ещё ищете ответ? Посмотрите другие вопросы с метками или задайте свой вопрос.