Я пытаюсь разместить мои элементы таким образом, чтобы кнопка занимала нижнюю часть экрана, а остальные элементы располагались последовательно в верхней части экрана, но без успеха. Последний EditExt (opedt) всегда отображается немного удаленно от остальных где-то посередине экрана. Какие изменения имеют их в желаемом порядке? Вот мой файл разметки XML:Элементы заказа в файле макета
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent"
android:background="@drawable/beezlinkbackg"
android:layout_height="match_parent" android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
android:paddingBottom="@dimen/activity_vertical_margin"
tools:context="gsie.beezlink.OpportunityActivity">
<RelativeLayout
android:id="@+id/footer"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:gravity="center" >
<Button
android:layout_width= "match_parent"
android:layout_height="wrap_content"
android:text="@string/posterbtn"
android:background="#008000"
android:id="@+id/posterbtn"
/>
</RelativeLayout>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/cinteretxt"
android:textSize="20sp"
android:textStyle="bold"
android:id="@+id/cinteretxt"
android:layout_alignParentTop="true"
/>
<Spinner
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/cinteretspin"
android:layout_below="@+id/cinteretxt"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/optitretxt"
android:textSize="20sp"
android:textStyle="bold"
android:id="@+id/optitretxt"
android:layout_below="@+id/cinteretspin"
/>
<EditText
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/optitreedt"
android:layout_below="@+id/optitretxt"
android:hint="@string/hintoptitre"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/optxt"
android:textSize="20sp"
android:textStyle="bold"
android:id="@+id/optxt"
android:layout_below="@+id/optitreedt"
/>
<EditText
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/opedt"
android:hint="@string/hintpost"
android:layout_below="@+id/optxt"
android:layout_above="@+id/footer"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true" />
</RelativeLayout>
Edit: Похоже, я присудили очки без хорошего тестирования. Когда я набираю длинный текст в последнем EditText (opedt), он перекрывает кнопку внизу. Текст находится поверх кнопки. Я хочу, чтобы текст остановился только до нажатия кнопки и свитков.
Второй относительный макет – Raghunandan
как ненужный идти об этом? –
удалите вторую относительную компоновку и добавьте 'android: layout_alignParentBottom =" true "' к кнопке – finki