NEW: Subscribe to Hacking with Swift+ and accelerate your learning! >>

Buttons on Scrollview (with frame and offset) do not work until scrolling a bit

Forums > SwiftUI

Hi everybody,

Actually, I wanted to figure out what’s wrong on my own, but I stuck and it is driving me crazy.

Here is my problem.

I created a move-in menu which moves from the bottom up. For this functionality I used a view which is moved out of scope with an offset (y-value). This offset will be modified to show the menu completely, show the menu minimized and hide the menu. Actually, that works fine.

This menu contains several buttons and a horizontal scrollview which contains some more buttons. When I use the frame-mofidier for the Scrollview or for at least one of the parental (H-, V- or Z-) Stacks, I am not able to use the buttons on the scrollview after changing the menu offset (menu is expanded completely or minimized) anymore until I scrolled a bit. After scrolling, all buttons are working correctly, before I do that they do not do anything. When I am using a V-Stack instead of the Scrollview, the buttons work fine. But I do not have the possibility to scroll, which is mandatory.

Are there any restrictions or things to think about for using a Scrollview in combination with offset and frame?

I hope you understand what I I tried to say. I am thankful for every hint.

Thanks, Sebastian


Hi! Had same problem on iOS13 but on iOS14 beta its fixed.


Subscribe to Hacking with Swift+

Sponsor Hacking with Swift and reach the world's largest Swift community!

Reply to this topic…

You need to create an account or log in to reply.

All interactions here are governed by our code of conduct.

Unknown user

Not logged in

Log in

Link copied to your pasteboard.