0
Я пытаюсь добавить красную кнопку (android:id="@+id/button8
) под фрагмент в новом слое в левой позиции, но он не может ответить и все еще в верхней части фотографии:Как добавить кнопку в новый слой слева внизу фрагмент
XML файл
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="bottom"
android:paddingBottom="@dimen/activity_vertical_margin"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin" >
<LinearLayout
android:id="@+id/topLayout"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:orientation="horizontal" >
<Button
android:id="@+id/button1"
android:layout_width="38dp"
android:layout_height="30dp"
android:background="#000000"/>
</LinearLayout>
<fragment
android:id="@+id/fragment"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_below="@id/topLayout" />
<LinearLayout
android:id="@+id/ttt"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="left"
android:orientation="horizontal" >
<Button
android:id="@+id/button8"
android:layout_width="38dp"
android:layout_height="30dp"
android:background="#FF0000" />
</LinearLayout>
не работает и до сих пор в верхней – user3350437
см исправленную версию. 'layout_below' не' ниже' – cosmincalistru
Я пытаюсь скорректировать код, но кнопка исчезает, и я могу, я вижу, где ее позиция – user3350437