Я относительно новичок в разработке Android, и мне сложно собрать определенный интерфейс. Я просмотрел много похожих вопросов, но ни один из них не дал мне ответ, который я ищу.Android Относительная компоновка с липким нижним колонтитулом
Я хочу, чтобы соединить интерфейс XML как следующее:
Я хочу LinearLayout, который действует как липкий колонтитул, который будет содержать две кнопки. Эта часть всегда будет выровняться по низу и будет всегда иметь 60dp. RelativeLayout затем будет поверх нижнего колонтитула, но высота должна масштабироваться в зависимости от размера экрана.
Я попытался следующие:
<LinearLayout 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:orientation="vertical"
tools:context=".DartboardActivity">
<RelativeLayout
android:id="@+id/game_layout"
android:layout_width="match_parent"
android:layout_height="506dp"
android:background="@drawable/background"
android:paddingBottom="@dimen/activity_vertical_margin"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin">
<ImageView
android:id="@+id/Dartboard"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:contentDescription="@string/desc_dartboard"
android:src="@drawable/dartboard" />
<hhs.week3.dartboard.VerticalSeekBar
android:id="@+id/seekBarVertical"
android:layout_width="wrap_content"
android:layout_height="fill_parent"
android:layout_gravity="bottom"
android:thumb="@drawable/thumbhorizontal"
android:layout_marginBottom="40dp" />
<SeekBar
android:id="@+id/seekBarHorizontal"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:thumb="@drawable/thumbhorizontal" />
</RelativeLayout>
<LinearLayout
android:id="@+id/buttons"
android:layout_width="match_parent"
android:layout_height="60dp"
android:background="#333">
<Button
android:id="@+id/fire"
style="@style/button"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_margin="5dp"
android:text="@string/fire" />
<Button
android:id="@+id/settings"
style="@style/button"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_margin="5dp"
android:text="@string/settings" />
</LinearLayout>
</LinearLayout>
Я получил это работает половину прилично, но это требует от меня, чтобы дать RelativeLayout укусил фиксированную высоту, что делает его смотреть прямо на свой телефон, но не на других ,
Как мне лучше всего подойти?