Android 1.5 の RelativeLayout でビューがオーバーラップするという問題が発生しています... Android 1.6 以降ではすべて正常に動作しています。
Android 1.5 には RelativeLayout に関するいくつかの問題があることは理解していますが、StackOverflow または Android 初心者グループで特定の問題を見つけることができませんでした。
私のレイアウトは 4 つのセクションで構成され、それぞれが TextView、Gallery、および垂直方向に配置された別の TextView で構成されています。
実行中のアプリ
最近のアプリ
サービス
プロセス
これらのアイテムの 4 つのセットがすべて表示されると、すべて正常に動作します。ただし、私のアプリでは、ユーザーがこれらの一部を表示しないように指定できます。ユーザーが実行中のアプリ、最近のアプリ、またはサービスをオフにすると、残りのセクションがすべて突然重複します。
これが私のレイアウト用のコードです。何が間違っているのかわかりません。ユーザーがセクションの表示をオフにすると、View.GONE 可視性設定を使用します。
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:gravity="center_vertical"
android:layout_gravity="center_vertical"
android:background="@null"
>
<!-- Running Gallery View Items -->
<TextView
style="@style/TitleText"
android:id="@+id/running_gallery_title_text_id"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="left"
android:paddingLeft="1sp"
android:paddingRight="10sp"
android:text="@string/running_title"
/>
<Gallery
android:id="@+id/running_gallery_id"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_below="@id/running_gallery_title_text_id"
android:spacing="5sp"
android:clipChildren="false"
android:clipToPadding="false"
android:unselectedAlpha=".5"
/>
<TextView
style="@style/SubTitleText"
android:id="@+id/running_gallery_current_text_id"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_below="@id/running_gallery_id"
android:gravity="center_horizontal"
/>
<!-- Recent Gallery View Items -->
<TextView
style="@style/TitleText"
android:id="@+id/recent_gallery_title_text_id"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@id/running_gallery_current_text_id"
android:gravity="left"
android:paddingLeft="1sp"
android:paddingRight="10sp"
android:text="@string/recent_title"
/>
<Gallery
android:id="@+id/recent_gallery_id"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_below="@id/recent_gallery_title_text_id"
android:spacing="5sp"
android:clipChildren="false"
android:clipToPadding="false"
android:unselectedAlpha=".5"
/>
<TextView
style="@style/SubTitleText"
android:id="@+id/recent_gallery_current_text_id"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_below="@id/recent_gallery_id"
android:gravity="center_horizontal"
/>
<!-- Service Gallery View Items -->
<TextView
style="@style/TitleText"
android:id="@+id/service_gallery_title_text_id"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@id/recent_gallery_current_text_id"
android:gravity="left"
android:paddingLeft="1sp"
android:paddingRight="10sp"
android:text="@string/service_title"
/>
<Gallery
android:id="@+id/service_gallery_id"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_below="@id/service_gallery_title_text_id"
android:spacing="5sp"
android:clipChildren="false"
android:clipToPadding="false"
android:unselectedAlpha=".5"
/>
<TextView
style="@style/SubTitleText"
android:id="@+id/service_gallery_current_text_id"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_below="@id/service_gallery_id"
android:gravity="center_horizontal"
/>
</RelativeLayout>
これを短く保つために(やや無駄な)試みで、プロセスセクションのxmlを省略しました...
Android 1.5 でこれを機能させるにはどうすればよいですか? すべてが表示されているときに正常に動作するため、xml 内のビューを並べ替えるだけの問題ではないと思います。