Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Make image go outside of boundaries in Jetpack Compose

I`m new to compose and am trying to use an Image() composable with this specifics:

enter image description here

The Image needs to have more height and width than it`s parent but from a fixed offset (the green dot).

How can I achieve this design with jetpack compose?

like image 861
DevineDecrypter Avatar asked Oct 23 '25 11:10

DevineDecrypter


1 Answers

Let's assume that your Sidebar is a Column, then the code would look like this:

Sidebar() {
  Column() { 
    TopSidebar() // top part of sidebar, but not fillMaxHeight

    Image(
      modifier = Modifier
        .wrapContentSize(unbounded = true, align = Alignment.TopStart),
      ... rest of parameters
    )
  }
}

The key things are unbounded = true and align. TopStart is your case

I wrote more about it with examples here on Medium

like image 137
Akbolat SSS Avatar answered Oct 25 '25 01:10

Akbolat SSS