Questions tagged [swiftui-scrollview]

For questions about ScrollView - a view in Apple's SwiftUI framework that is scrollable. When using this tag also include the more generic [swiftui] tag where possible.

Links:

127 questions
1
vote
0 answers

How to use ScrollViewReader to scroll to proper BarMark

Im trying to resolve the animated transition to the correct one BarMark using Charts library. The first idea was to add to each element id and next using .scrollTo(id) from ScrollViewReader. Unfortunately, it doesn't work. import SwiftUI import…
1
vote
1 answer

SwiftUI ScrollView messing up picker selection behaviour

I'm building a WatchOS-app (SwiftUI) with multiple pickers, but as soon as I add them to a ScrollView I can no longer simply tap a picker to select it. When I tap a picker the first picker on the screen gets selected and I have to tap once more to…
1
vote
0 answers

SwiftUI ScrollView extra padding when go to another screen with showed keyboard

The default "Keyboard Avoidance" SwiftUI is used. First GIF If you put the code in VStack and add another View to it, then the container rises Second GIF I don't want to delete Keyboard Avoidance. I need to remove extra…
jarakys
  • 11
  • 2
1
vote
1 answer

Disable Horizontal scrolling on using PageTabViewStyle for tabView swiftui

This is how my tabView looks like. I want the views to have a page feel thats why I'm using PageTabViewStyle, but I don't want the page to be scrollable on users swipe. How can I disable just the horizontal swipe/drag on the…
1
vote
0 answers

Render a TabView within a ScrollView

I'm trying recreate a view in SwiftUI that has the same behaviour as the Twitter profile page. The expected behaviour is a stretchy header, with tabbed views underneath. The content size of each tab will differ, however when changing tab the view…
Harry Blue
  • 4,202
  • 10
  • 39
  • 78
1
vote
1 answer

SWIFTUI - How to disable scrolling up if users are already at the top of a ScrollView and vice versa

How the scroll view looks normally What I DON'T WANT TO HAPPEN As you can see from the images, I do not want to allow users to be able to scroll further up if they are already at the top, or scroll further down if they are already at the…
1
vote
1 answer

SwiftUI - How to add a pageTabView inside a scrollview with PinnedViews

I had one problem while using SwiftUI. I have implemented a sectionHeader using PinnedView which is currently scrollable all up and down, has a header area, and is LazyVStack. Below is the implementation to show the corresponding content. struct…
okstring
  • 11
  • 1
1
vote
0 answers

SwiftUI: Button Nested Inside ScrollView Won't Fire (WatchOS)

I've tried everything I can think of but I can't get this button to fire consistently when nested inside a ScrollView. If I change the ScrollView to a List, it works fine, but I don't want the UI of a list on the Watch, I would prefer to use a…
GarySabo
  • 5,806
  • 5
  • 49
  • 124
1
vote
0 answers

SwiftUI transmit drag focus to outer view (ScrollView inside dragable)

What I want I have a "ScrollView" in a custom sheet that I can drag down to close. Of course, the ScrollView is above the drag area, so when I drag over the ScrollView it scrolls down or up. I want to disable the ScrollView when I am at the top of…
Jozott
  • 2,367
  • 2
  • 14
  • 28
1
vote
0 answers

SwiftUI UIViewRepresentable ScrollView is not zooming

I am developing an iOS app using the SwiftUI. I need to implement the "pinch to zoom" feature in the app so i tried using the SwiftUI's ScrollView but went in to the problems of not able to pinch and drag the content at the same time as discussed in…
Hariprasad
  • 1,094
  • 2
  • 12
  • 30
1
vote
1 answer

SwiftUI: Scrolling Sticking when using LazyVGrid inside a Scrollview:

The below code seems to work fine on an iPhone 13 mini but stutters or sticks when scrolling on an iPhone 13, not every time but often. The code for the Calendar is here. What could be causing this? struct MasterCalendarWithDay: View { …
GarySabo
  • 5,806
  • 5
  • 49
  • 124
1
vote
0 answers

SwiftUI - How to Tell When a User Interacts with the Scroll View and not Programmatically?

I am trying to find out when the user interacts with a horizontal ScrollView in SwiftUI. The problem is that most solutions that I have found are based around when the scroll view moves. This doesn't work as the scroll view also moves without the…
Mr Duck
  • 115
  • 1
  • 9
1
vote
1 answer

How to avoid using `AnyView` type erasure in closures for callback, in SwiftUI?

I'm trying to create table views based on both List and ScrollView, with a shared base view. My current attempt uses a builder-based approach, but requires closures with AnyView type erasure. My goal is to avoid using AnyView type erasure, to…
1
vote
1 answer

Scroll to bottom of a list populated with CoreData in SwiftUI

I'm trying to scroll to the bottom of List when a button is tapped. I have tried placing the List in a ScrollViewReader and this seems to work only when the List is populated using an array. When I populate the List using CoreData's FetchedResults…
unknown
  • 788
  • 9
  • 24
1
vote
1 answer

Center Scroll View content

I have centered my Scroll View by using GeometryReader like this: struct ContentView: View { var body: some View { NavigationView { GeometryReader { geom in ScrollView(.vertical, showsIndicators: false) { …
Isaac
  • 368
  • 4
  • 12
1 2 3
8 9