简体   繁体   中英

how to change paddings in dialog window in jetpack compose?

I need to write a composable function that, like a dialog window, will be displayed over the rest of the screen elements. I wrap the contents of my composable function in Dialog(). But there are paddings on all sides of the screen. How can they be removed?

screenshot of problem , red lines are paddings that need to be removed

I use dialog in my function something like this:

@Composable
fun MyFunction(){
  Dialog(onDismissRequest = { }) {
    //content
  }
}

You can do this:

        @Composable
        fun MyFunction(){
        Dialog(onDismissRequest = { },
        properties = DialogProperties(usePlatformDefaultWidth = false)) {
        Box(modifier = Modifier.fillMaxSize()) {
        //content
      }
    }
  }

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM