Can Frame A respond to Frame B's changing height, even if Frame B's position is fixed?

Ok, I realise that title might be a little confusing, so I’ve added pictures to demonstrate what I mean.

I know how to make the header’s position fixed to the top and the panel content scrollable. BUT what I’m trying to figure out is how to make the panel content “stick” to the bottom of the header even when I resize the content in the header.

In other words: if I add a description to the header, the header will get bigger. If the header gets bigger, then the panel content frame should shift down instead of staying in the same place and not moving with the header.

Placing the header and the panel content frames in an auto-layout frame won’t work in this scenario because I want the header to be above the panel content when it’s scrolling, so the header is always visible.

I’m trying to build a reusable side panel component, so if this method isn’t possible, is there a better way I could be doing this?

Thanks in advance!

Here’s a link to a file you can duplicate to your drafts that I think matches your use case. I’m using Auto Layout (so you can get the dynamic sizing right) and just added vertical scrolling overflow to the text content underneath.

Appreciate the help here. I think this is what I’ll have to end up doing.

The reason I was wanting to avoid this was that in our design system our headers have a drop shadow which gets cut off when I put those headers in an autolayout frame. Unfortunate, but I may have to ditch the shadow to make this work. Or maybe a little inner shadow instead.

Thanks again

@Chris_Hiddins I updated my file to show how you can achieve the drop shadow by doing a “double-flip” technique to reverse the z-index in Auto Layout.

Here’s a link to a community file by Chudo Loo that does a great job explaining how the technique works.

It looks hacky but I think it works solidly enough in a production environment. I use it frequently to fix things like the drop shadow issue you described.

1 Like

@ntfromchicago Brilliant hack, thank you for this! I can already imagine a number of other areas where I can implement this. Really appreciate it!