Есть ли способ сместить вид из центра в Android?

я пытаюсь использовать кнопку не точно в центре, но, скажем, в 2/5 высоты экрана, я безуспешно искал атрибут, поэтому я попробовал этот подход

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@drawable/background"
android:padding="20dp" >

 <ImageButton
    android:id="@+id/flashlight_button"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_centerHorizontal="true"
    android:layout_above="@+id/fakeView"
    android:background="@null"
    android:contentDescription="@string/flashlight_button_description"
    android:src="@drawable/freeml_bright" />

   <View
    android:id="@+id/fakeView"
    android:layout_width="10dp"
    android:layout_height="10dp"
    android:layout_centerInParent="true"
    android:background="#FFAABB" />

</RelativeLayout>

однако это не работает, даже если я установил поле для поддельного представления.

Есть идеи?

//РЕДАКТИРОВАТЬ//

спасибо за ответы, ребята, атрибут padding работает, однако, поскольку это большое изображение, и если я хочу, чтобы оно начиналось с 2/5 высоты экрана, оно охватывает центральную точку экрана, поэтому, если я использую атрибут padding, оно работает, но отталкивает его от центра и не позволяет покрыть. Извините, это моя ошибка

Тем не менее, я сделал так, чтобы это работало с использованием линейного макета, чего я хотел избежать, потому что есть больше видов сверху и снизу рядом друг с другом, так что это привело бы к вложенным представлениям с использованием линейного макета. К сожалению, я думаю, что это единственный вариант.

В основном он использует другой линейный макет, который заполняет оставшееся пространство, оставленное неиспользованным сверху и снизу с высоты = 0dp и weight = 1, и устанавливает его гравитацию в центр

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:padding="20dp">

<LinearLayout
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:orientation="horizontal"
    android:gravity="center" >

    <ImageView
        android:id="@+id/imageView1"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:contentDescription="@string/application_logo_description"
        android:src="@drawable/mylight" />

     <ImageButton
        android:id="@+id/settings_button"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_gravity="right"
        android:background="@null"
        android:contentDescription="@string/settings_button_description"
        android:src="@drawable/settings_button" /> 
</LinearLayout>

<LinearLayout
    android:layout_width="match_parent"
    android:layout_height="0dp"
    android:layout_weight="1"
    android:gravity="center"
    android:orientation="vertical" >

    <ImageButton
        android:id="@+id/flashlight_button"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:background="@null"
        android:contentDescription="@string/flashlight_button_description"
        android:src="@drawable/flashlight_button_selector" />

    <View
        android:id="@+id/fakeView"
        android:layout_width="0dp"
        android:layout_height="0dp"
        android:layout_marginTop="60dp"
        android:background="#FFAABB" />
</LinearLayout>

<ImageView
    android:id="@+id/imageView2"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_gravity="bottom|center_horizontal"
    android:contentDescription="@string/powered_by_description"
    android:src="@drawable/powered_by" />

<ImageButton
    android:id="@+id/ad_button"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_gravity="bottom|center_horizontal"
    android:background="@null"
    android:contentDescription="@string/ad_button_description"
    android:src="@drawable/freeml" />

 </LinearLayout>

Спасибо за ваш вклад.

Ответы на вопрос(3)

Ваш ответ на вопрос