макет Android с жидким заголовком - PullRequest
0 голосов
/ 09 января 2012

Мне нужно создать собственный заголовок для моего приложения для Android. Я хотел бы создать что-то вроде

+----------------+------------+
|                |            |
| background     |   Logo     |
|  repeat        |   fixed    |
|                |   right    |
+----------------+------------+
|                             |
|                             |
|        content (list)       |
|                             |
|                             |
|                             |
+-----------------------------+
|        footer repeat        |
+-----------------------------+

Теперь я написал xml для списка, но у меня проблема с заголовком, потому что я не знаю, как его создать

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical"
android:background="#fff" >

<RelativeLayout
    android:id="@+id/top_control_bar"
    android:layout_width="fill_parent"
    android:layout_height="88dp" >

    <View xmlns:android="http://schemas.android.com/apk/res/android"
        android:layout_width="fill_parent"
        android:layout_height="20dp"
        android:background="@drawable/top_menu_bg_tile"/>

    <ImageView
        android:layout_width="wrap_content"
        android:layout_height="88dp"
        android:src="@drawable/top_menu" />     

</RelativeLayout>

<RelativeLayout
    android:id="@+id/bottom_control_bar"
    android:layout_width="fill_parent"
    android:layout_height="28dp"
    android:layout_alignParentBottom="true">

    <ImageView
        android:layout_width="match_parent"
        android:layout_height="28dp"
        android:layout_alignParentBottom="true"
        android:src="@drawable/bottom_menu" />

</RelativeLayout>

<ListView
    android:id="@android:id/list"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:layout_above="@id/bottom_control_bar"
    android:layout_below="@id/top_control_bar" >
</ListView>

Кроме того, мне нужно знать, является ли относительный макет лучшим способом o Мне нужно написать таблицу.

1 Ответ

0 голосов
Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...