Jetpack Compose [ModalBottomSheetLayout + BottomSheetScaffold + 脚手架]

问题描述 投票:0回答:0

我在我的 Jetpack Compose 应用程序中有一个要求,我需要在其中显示 modal bottom sheetpersistent bottom sheet 以及 bottom navigation

我怎样才能在一个屏幕上使用所有这三个

我已经根据这个reference尝试了这个布局 我有下面的嵌套布局结构

ModalBottomSheetLayout
   |- BottomSheetScaffold
      |- Scaffold
         |- BottomNavigation

当我使用这个结构时,我面临着关闭和打开 modal bottom sheetpersistent bottom sheet

的问题

我怎样才能实现这三个布局?


代码

 ModalBottomSheetLayout(
        sheetContent = {
            // MODAL SHEET CONTENT
        },
        sheetState = modalBottomSheetState,
    ) {
        BottomSheetScaffold(
            sheetContent = {
                // BOTTOM SHEET CONTENT
            },
            scaffoldState = bottomSheetScaffoldState,
            sheetPeekHeight = 0.dp,
        ) {
            Scaffold(
                scaffoldState = scaffoldWithDrawerState,
                drawerContent = {
                  // DRAWER CONTENT
                },
                bottomBar = {
                    BottomBar(navController = navController)
                },
            ) {
               // NAV HOST FOR THE BOTTOM NAVIGATION SCREENS
            }
        }
    }
android android-jetpack-compose android-jetpack jetpack android-compose-layout
© www.soinside.com 2019 - 2024. All rights reserved.