From de74e5ec3fbdab065e8b91240fa1944c4b3440c2 Mon Sep 17 00:00:00 2001 From: Administrator <123> Date: Wed, 03 Nov 2021 07:41:03 +0000 Subject: [PATCH] 部分调整 --- app/src/main/res/layout/activity_main.xml | 24 +++++++++++++----------- 1 files changed, 13 insertions(+), 11 deletions(-) diff --git a/app/src/main/res/layout/activity_main.xml b/app/src/main/res/layout/activity_main.xml index 177d7d2..9db3053 100644 --- a/app/src/main/res/layout/activity_main.xml +++ b/app/src/main/res/layout/activity_main.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="utf-8"?> -<LinearLayout +<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" android:id="@+id/container" @@ -7,21 +7,23 @@ android:layout_height="match_parent" android:orientation="vertical"> - <fragment - android:id="@+id/nav_host_fragment_activity_main" - android:name="androidx.navigation.fragment.NavHostFragment" + <androidx.viewpager2.widget.ViewPager2 + android:id="@+id/view_pager_2" android:layout_width="match_parent" - android:layout_height="match_parent" - android:layout_weight="1" - app:defaultNavHost="true" - app:navGraph="@navigation/mobile_navigation" - /> - + android:layout_height="0dp" + app:layout_constraintTop_toTopOf="parent" + app:layout_constraintLeft_toLeftOf="parent" + app:layout_constraintRight_toRightOf="parent" + app:layout_constraintBottom_toTopOf="@id/nav_view" /> <com.google.android.material.bottomnavigation.BottomNavigationView android:id="@+id/nav_view" android:layout_width="match_parent" android:layout_height="wrap_content" android:background="?android:attr/windowBackground" + app:layout_constraintTop_toBottomOf="@id/view_pager_2" + app:layout_constraintLeft_toLeftOf="parent" + app:layout_constraintRight_toRightOf="parent" + app:layout_constraintBottom_toBottomOf="parent" app:menu="@menu/bottom_nav_menu"/> -</LinearLayout> \ No newline at end of file +</androidx.constraintlayout.widget.ConstraintLayout> \ No newline at end of file -- Gitblit v1.9.1