Time:10-05
CodePudding user response:
code is coming, whether the layout in your activity or fragments loaded correctly?
& lt; ? The XML version="1.0" encoding="utf-8"?> XMLNS: app="http://schemas.android.com/apk/res-auto" XMLNS: tools="http://schemas.android.com/tools" The android: id="@ + id/container" Android: layout_width="match_parent" Android: layout_height="match_parent" & gt; The android: id="@ + id/nav_view" Android: layout_width="0 dp" Android: layout_height="wrap_content" Android: layout_marginStart="0 dp" Android: layout_marginEnd="0 dp" Android: background="? Android: attr/windowBackground "App: layout_constraintBottom_toBottomOf="parent" App: layout_constraintLeft_toLeftOf="parent" App: layout_constraintRight_toRightOf="parent" App: menu="@ menu/bottom_nav_menu"/& gt; The android: id="@ + id/nav_host_fragment" The android: name="androidx. Navigation. Fragments. NavHostFragment" Android: layout_width="match_parent" Android: layout_height="match_parent" App: defaultNavHost="true" App: layout_constraintBottom_toTopOf="@ id/nav_view" App: layout_constraintEnd_toEndOf="parent" App: layout_constraintLeft_toLeftOf="parent" App: layout_constraintTop_toTopOf="parent" App: layout_constraintVertical_bias="0.0" App: navGraph="@ navigation/mobile_navigation"/& gt;
Page link:https//www.codepudding.com/Mobile/52116.html