この問題の原因を以下で説明したこの 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
スペースがあり、その間に接続されていないスペースがあり、重複を引き起こしている可能性があることにも気付くでしょう。
この重なり合う構造を解決するにはどうすればよいでしょうか?