UPGRADE YOUR SKILLS: Learn advanced Swift and SwiftUI on Hacking with Swift+! >>

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

2      

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

2      

TAKE YOUR SKILLS TO THE NEXT LEVEL If you like Hacking with Swift, you'll love Hacking with Swift+ – it's my premium service where you can learn advanced Swift and SwiftUI, functional programming, algorithms, and more. Plus it comes with stacks of benefits, including monthly live streams, downloadable projects, a 20% discount on all books, and free gifts!

Find out more

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

Archived topic

This topic has been closed due to inactivity, so you can't reply. Please create a new topic if you need to.

All interactions here are governed by our code of conduct.

 
Unknown user

You are not logged in

Log in or create account
 

Link copied to your pasteboard.