右側にボタンがあり、クリックするとリストビューを左にスライドするヘッダーを含むアプリケーションを作成しています(Facebookのチャットリストと同様)
->
リストビューを入れずにこのヘッダーを含めたところ、正しく機能していました。しかし今、私はこのリストビューを.xml
ヘッダーのファイル内に挿入しています(ヘッダーは常にユーザーに表示され、ユーザーは表示されている任意のレイアウトでこのリストビューボタンをクリックできるため)。外観を変更せずにこのヘッダーを他のすべてのレイアウトに含め、ボタンをクリックするたびにこのリストを表示したいという問題。私はたくさんの答えを検索して見つけましたが、すべての解決策は、各ページの前のスクリーンショットで行ったのと同じものを作成することであり、複数のページに対する楽観的な解決策ではありません。
* APIレベル10に取り組んでおり、を使用せずに解決策を見つけたいと考えていますActionbar
。
より多くの情報が役立つかどうか教えてください、どんな助けでも本当にありがたいです。前もって感謝します。
私のxmlファイルを更新します:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/GeneralRelativeLayout"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical">
<RelativeLayout android:id="@+id/rel_layout"
android:layout_width="200dp"
android:layout_height="fill_parent"
android:background="@android:color/white" android:layout_alignParentRight="true">
<LinearLayout android:id="@+id/fake_layout"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical"
android:visibility="gone"></LinearLayout>
<ListView android:id="@+id/list_view"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="right"
android:background="@android:color/background_dark"
></ListView>
</RelativeLayout>
<RelativeLayout android:id="@+id/rel_layout_second"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@android:color/black">
<LinearLayout android:id="@+id/lin_layout"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:background="@android:color/background_light"
android:orientation="vertical"
android:layout_centerHorizontal="true" android:layout_alignParentTop="true">
<Button android:id="@+id/button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="slide"
android:layout_gravity="right|center"></Button>
</LinearLayout>
</RelativeLayout>
</RelativeLayout>