1

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?

DevineDecrypter
  • 151
  • 1
  • 16

1 Answers1

2

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(unbound = true, align = Alignment.TopStart),
      ... rest of parameters
    )
  }
}

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

I wrote more about it with examples here on Medium

Akbolat SSS
  • 1,761
  • 15
  • 23