У меня есть две кнопки. Я хочу, чтобы один был выровнен по верхнему центру приложения. Я хочу получить другую кнопку, чтобы игнорировать настройки гравитации и идти туда, куда я говорю. Как мне это сделать?
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/relative_layout"
android:layout_width="fill_parent"
android:gravity="center_horizontal"
android:layout_height="fill_parent" >
<Button
android:id="@+id/the_button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Centered Button"
android:layout_alignTop="@id/relative_layout" />
<Button
android:id="@+id/the_button2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Random Button"
android:ignoreGravity="@id/relative_layout" />
</RelativeLayout>