android 如何删除Material3中ModalNavigationDrawer()组件的右上角和右下角圆角?

cgyqldqp  于 2023-05-05  发布在  Android
关注(0)|答案(1)|浏览(186)

检查下面的图像:

我试过这个,但没有工作。

ModalNavigationDrawer(
        drawerState = drawerState,
        drawerContent = {
            ModalDrawerSheet(
                //case-1
                modifier = Modifier.clip(RectangleShape), //<--- It draws a shape in background of drawer.
                //or
                //case-2
                modifier = Modifier.background(Color.White), //<--- It draws a color in background of drawer.
            ) {
                //Drawer Items here
            }
        },
        content = {
            //Scaffold here
        }
    )

你可以在这里看到ModalNavigationDrawer的官方文档。

ddrv8njm

ddrv8njm1#

ModalDrawerSheet有一个drawerShape选项:

ModalDrawerSheet(
    drawerShape = RectangleShape,
) {
    //Drawer Items here
}

相关问题