Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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
  }
}
like image 223
e30n3 Music Avatar asked Oct 17 '25 10:10

e30n3 Music


1 Answers

You can do this:

        @Composable
        fun MyFunction(){
        Dialog(onDismissRequest = { },
        properties = DialogProperties(usePlatformDefaultWidth = false)) {
        Box(modifier = Modifier.fillMaxSize()) {
        //content
      }
    }
  }
like image 75
Code Poet Avatar answered Oct 18 '25 23:10

Code Poet



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!