209 questions
0
votes
0
answers
44
views
SwiftUI .refreshable causes misaligned button tap targets in ScrollView
I have a ScrollView with several Buttons and a .refreshable modifier. As soon as I pull to refresh and the refresh indicator appears, the tap targets no longer match the visible button positions. For ...
3
votes
1
answer
4k
views
SwiftUI scrollview sticky header without using List
I've been fighting with GeometryReader and .onChange(of: geo.frame(in: .global).minY) for a long time trying to get this to work with no great success. Consider the following:
struct TestScreen: View {...
0
votes
1
answer
87
views
How to make a Button work inside a ScrollView but outside of the ScrollView's bounds in SwiftUI?
I observed a weird behavior and I believe it's a bug in SwiftUI but maybe it's not or someone knows a way to fix it.
By default, overlays have the same size as the view they are attached to in SwiftUI....
6
votes
5
answers
1k
views
Disable Interactive Dismissal of Navigation Transitions in SwiftUI
I am using the new navigationTransitionStyle(.zoom(id, namespace)) to zoom from a view preview to a detail view in my swiftUI app.
My issue is that I have a snapping scrollView in the detail view, ...
1
vote
1
answer
97
views
Collapsible header hides after pull-down gesture
I’m trying to implement a collapsible header in SwiftUI that collapses when the user scrolls down and expands when the user scrolls up.
I followed this Medium post: Collapsible Header in SwiftUI
The ...
1
vote
1
answer
132
views
How to synchronize the scroll position between two repeating, scrollable views?
I am trying to recreate this view from an app. essentially its two repeating/infinite scrollable views. the top contains the days of the week, and the bottom is a paging view that shows the classes on ...
1
vote
1
answer
81
views
SwiftUI ScrollPosition and viewAligned behavior
I have a discrete scrubber implementation using ScrollView in SwiftUI that works but fails in the end points sometimes. For instance, scrolling it all the way to bottom shows a value of 87 instead of ...
0
votes
0
answers
99
views
How to maintain scroll position across tabs and rotation in SwiftUI?
I have a view called SurahView. In this view, I need 2 modes: translation and reading.
In the translation mode, I have a series of verses with both the Arabic text and English text for each verse.
In ...
0
votes
1
answer
84
views
Scrollable list items flicker when keyboard is dimissed
In code below, when the list has more items than can fit on the screen, when the keyboard is dismissed the list items flicker, appear jittery. I have not been able to find a solution. I suspect ...
1
vote
1
answer
312
views
Compose Multiplatform Composable View not scrolling in IOS Scroll view when scrolled from Composable View
I integrated a composable view into my Compose Multiplatform project and embedded it within an iOS UIScrollView. I expected the scroll view to function as intended, allowing smooth vertical or ...
0
votes
2
answers
244
views
SwiftUI ScrollView scrollTargetLayout not working
I have the following scrubber implementation in SwiftUI. The + button is supposed to move the ScrollView up by 1 tick (or scrollPosition incremented by 1) but the issue is no scrolling happens until I ...
4
votes
1
answer
5k
views
SwiftUI ScrollView gesture recogniser
How can I detect when a ScrollView is being dragged?
Within my ScrollView I have an @Binding scrollPositionOffset variable that I watch with .onChange(of:) and then programmatically scroll to that ...
1
vote
1
answer
81
views
List cannot scroll vertically If hovered a List subview that needs to support horizontal scrolling
I have a List that contains some views, some of which need horizontal scrolling. It is important to note that none of the views require vertical scrolling. When my mouse hovers over the views that do ...
79
votes
7
answers
27k
views
Putting a LazyVStack or LazyHStack in a ScrollView causes stuttering
Xcode Version 12.4 (12D4e)
I have encountered this every time I have implemented a Lazy stack within a ScrollView:
Add a LazyHStack to a horizontal ScrollView or a LazyVStack to a vertical ScrollView
...
0
votes
2
answers
380
views
SwiftUI scrollTo function stops working if I also use onScrollVisibilityChange with custom id tag
SwiftUI's scroll behavior is vexing.
So, using iOS 18 newest APIs...
If I use a custom id tag and scrollTo on its own, it works fine (actually not fine, it often scrolls to the wrong place with ...
0
votes
0
answers
74
views
strange line when putting scrollview inside of NavigationView- SwiftUI MacOS
If i have the following code in a SwiftUI view:
NavigationView {
NavigationLink(destination: ScrollView{}, label: {
Text("Thing")
})
}
It creates this ...
5
votes
6
answers
6k
views
SwiftUI: ScrollView that drags bottom sheet with it
I'm trying to create a SwiftUI Scrollview that drags its container like this: https://drive.google.com/file/d/1O92DgsVI1OjM1HEUXUwVywB8gcdShOP-/view?usp=sharing
Many Apple apps use this (Apple Maps, ...
0
votes
0
answers
87
views
How to implement Snapchat-style circular image carousel with ScrollView?
Swift Beginner, I want to achieve a scrolling effect similar to Snapchats filter changer.
It's a static circlestroke with round images you can drag into it. Here's a Screenshot.
I'm using a horizontal ...
0
votes
1
answer
333
views
Make rows of SwiftUI Grid 'scrollable'
I have SwiftUI grid of 25 rows with a first header row and a totals row at the bottom. I would like the header and the totals row to remain fixed, but allow the user to scroll the 23 rows (as they ...
9
votes
1
answer
4k
views
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 ...
4
votes
3
answers
763
views
ScrollView with .viewAligned and .scrollPosition() not updating on orientation / size changes
The scroll position is not updated when orientation changes in a ScrollView with .scrollTargetBehavior(.viewAligned) and .scrollPosition().
import SwiftUI
struct ContentView: View {
let colors: [...
0
votes
0
answers
143
views
Issues with displaying Images in SwiftUI
I have an issue with loading Images from SwiftData or from Disk (Directory Folder) into a SwiftUI View.
In the below example is the ScrollView with the LazyVGrid loading Images from SwiftData - (...
0
votes
0
answers
73
views
Dynamic resizing within ScrollView with limited maxWidth and maxHeight for one component and flexible for another?
I'm working with a vertical ScrollView in SwiftUI, and I want to have dynamic resizing for two components inside it. Specifically, I want one component to have a constrained maxWidth and maxHeight (up ...
9
votes
2
answers
2k
views
SwiftUI viewAligned scrollTargetBehavior for ScrollView where scrollTargetLayout subviews are irregular in size
I'm trying to use SwiftUI's viewAligned scrollTargetBehavior for a ScrollView where scrollTargetLayout subviews are irregular in size.
Here's an example, which I've simplified for the purpose of ...
0
votes
0
answers
75
views
SwiftUI Spline 3d model inside of ScrollView
I'm a beginner to Swift and SwiftUI and I am building a side-project. I am attempting to load an interactive 3d model (fetching from Spline Cloud link) into a ScrollView, but the gestures with the 3d ...