0

この問題の原因を以下で説明したこの XML ファイルが原因で、レイアウトが重複しています。

<FrameLayout
    android:id="@+id/main_frame_top_navigation"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:layout_alignParentLeft="true"
    android:layout_alignParentTop="true" >
</FrameLayout>

<FrameLayout
    android:id="@+id/main_frame_button"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:layout_alignParentLeft="true"
    android:layout_alignParentTop="true"
    android:layout_below="@+id/main_frame_top_navigation" >
</FrameLayout>

<FrameLayout
    android:id="@+id/main_frame_tab"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:layout_below="@+id/main_frame_button" >
</FrameLayout>


<FrameLayout
    android:id="@+id/translucent_container"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:layout_below="@+id/main_frame_tab" >
</FrameLayout>

<FrameLayout
    android:id="@+id/main_frame_content"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:layout_below="@+id/main_frame_tab" >
</FrameLayout>

<FrameLayout
    android:id="@+id/main_frame_title_bar"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:layout_below="@+id/main_frame_content"
    android:orientation="horizontal" >
</FrameLayout>

<FrameLayout
    android:id="@+id/main_frame_time_bar"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:layout_below="@+id/main_frame_title_bar"
    android:orientation="horizontal" >
</FrameLayout>

<FrameLayout
    android:id="@+id/main_frame_login"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:layout_below="@+id/main_frame_time_bar"
    android:orientation="horizontal" >
</FrameLayout>

<FrameLayout
    android:id="@+id/main_frame_bottom_navigation"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:layout_alignParentBottom="true"
    android:layout_below="@+id/main_frame_login"
    android:layout_alignParentRight="true" >
</FrameLayout>

表示されるレイアウトは、すべてのコンテナのリストです。コンテナを配置した後、オーバーラップが発生したため、バグがあることに気付きました。

私のアプリケーションのUIは次のとおりです。

ここに画像の説明を入力

アプリケーションのメイン コンテナは、その高さが下にある現在のコンテナに依存するため、高さmain_frame_tabとともに追加されます。私が望むものを達成できず、この問題を解決できないため、match_parent変更できません。wrap_content

この重複するバグの主な理由は、メニューの一部のコンテンツが実際にはページ下部のメニューの下に配置されていることです。

さらに説明すると、コンテナのセットアップがlayout_below途中まで使用されており、私が使用した一番下のコンテナにlayout_aboveスペースがあり、その間に接続されていないスペースがあり、重複を引き起こしている可能性があることにも気付くでしょう。

この重なり合う構造を解決するにはどうすればよいでしょうか?

4

1 に答える 1

0
// try this

<FrameLayout
        android:id="@+id/main_frame_top_navigation"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_alignParentLeft="true"
        android:layout_alignParentTop="true" >
    </FrameLayout>

    <FrameLayout
        android:id="@+id/main_frame_button"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_alignParentLeft="true"
        android:layout_below="@id/main_frame_top_navigation" >
    </FrameLayout>

    <FrameLayout
        android:id="@+id/main_frame_tab"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_below="@id/main_frame_button" >
    </FrameLayout>

    <FrameLayout
        android:id="@+id/translucent_container"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_below="@id/main_frame_tab" >
    </FrameLayout>

    <FrameLayout
        android:id="@+id/main_frame_content"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_toRightOf="@id/translucent_container"
        android:layout_marginLeft="5dp"
        android:layout_below="@id/main_frame_tab" >
    </FrameLayout>

    <FrameLayout
        android:id="@+id/main_frame_title_bar"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_below="@id/main_frame_content"
        android:orientation="horizontal" >
    </FrameLayout>

    <FrameLayout
        android:id="@+id/main_frame_time_bar"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_below="@id/main_frame_title_bar"
        android:orientation="horizontal" >
    </FrameLayout>

    <FrameLayout
        android:id="@+id/main_frame_login"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_below="@id/main_frame_time_bar"
        android:orientation="horizontal" >
    </FrameLayout>

    <FrameLayout
        android:id="@+id/main_frame_bottom_navigation"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_alignParentBottom="true"
        android:layout_alignParentRight="true"
        android:layout_below="@id/main_frame_login" >
    </FrameLayout>
于 2013-09-13T07:10:32.830 に答える