Shrinking header

Does anyone know how to shrink an element, like a header, while scrolling? I want the user to be able to scroll down, and as they do, the header shrinks to take up less space, and then stay at the top.
I tried creating a second frame with smart animation, but there is no prototyping interaction called “scrolling.” There’s the option to navigate to a new frame on “dragging” but not scrolling. Is there anyway to do this? An example of this would be iphone’s messaging app, where the header changes to save space, but then stays at the top as you scroll through messages