J'essayais d'avoir une carte affichée sur l'un des fragments de la navigation inférieure.
Mais, le fragment attaché ne couvre pas l'écran complet. J'ai essayé d'ajouter une couleur d'arrière-plan au fragment est aussi ci-dessous: p>
en essayant d'ajouter une carte au fragment. Ne convertissant pas l'écran complet, il ne montre qu'un peu de l'écran. En dessous de mon code de mise en page: P>
Bottom Navigation.xml: P>
mapFragment = (SupportMapFragment) this.getChildFragmentManager().findFragmentById(R.id.map);
3 Réponses :
Si NESTEDSCrollView n'est pas nécessaire, essayez d'utiliser un autre groupe de visitement, c'est-à-dire linearlayout ou relativenelayout à sa place. Il semble que le problème soit dans la teneur en fragments d'emballage à l'intérieur de NèseCrollView. P>
Ajouter Android: FiNDViewPort = "True" dans NESTECROLLVIEW
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" android:id="@+id/container" android:layout_width="match_parent" android:layout_height="match_parent" android:background="@color/grey_5"> <include android:id="@+id/search_bar" layout="@layout/include_card_view_search_bar" /> <androidx.core.widget.NestedScrollView android:id="@+id/nested_scroll_view" android:layout_width="match_parent" android:layout_height="match_parent" android:scrollbars="none" android:scrollingCache="true" android:fillViewport="true"> <LinearLayout android:layout_width="match_parent" android:layout_height="match_parent" android:descendantFocusability="blocksDescendants" android:orientation="vertical"> <View android:layout_width="match_parent" android:layout_height="?attr/actionBarSize" android:layout_marginBottom="@dimen/spacing_middle" /> <FrameLayout android:id="@+id/content" android:layout_width="match_parent" android:layout_height="match_parent" android:layout_weight="1" android:background="@color/blue_500"/> </LinearLayout> </androidx.core.widget.NestedScrollView> <com.google.android.material.bottomnavigation.BottomNavigationView android:id="@+id/navigation" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_alignParentBottom="true" android:layout_gravity="bottom" android:background="@color/blue_grey_700" app:itemIconTint="@drawable/color_state_white_2" app:itemTextColor="@drawable/color_state_white_2" app:menu="@menu/menu_bottom_navigation_shifting" /> </RelativeLayout>
J'avais le même problème, ScrollView était en train d'envelopper le contenu du fragment. Android: Fidviewport = "vrai" code> a fait ce dont j'ai besoin merci
Vous avez pris FRAMELAYOUT (Contentant ID) à l'intérieur de NèseCrollView, essayez de supprimer NéDScrollView de là et de l'ajouter à la mise en page par laquelle vous le remplacez avec Framelayout (Contenu ID) P>
J'ai besoin de la vue de défilement imbriquée, car j'utilise OnscrollChanGelistener et masquant la barre d'outils et la barre de navigation inférieure