Skip to main content
Filter by
Sorted by
Tagged with
79 votes
7 answers
27k views

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 ...
chrysb's user avatar
  • 1,581
14 votes
3 answers
6k views

Ever since Xcode 16, whenever there is a subview with a horizontal DragGesture inside a vertical ScrollView, horizontal drag gesture is detected on the subview but any scrolling up/down is not ...
Shri's user avatar
  • 213
13 votes
4 answers
4k views

So I'm try to use ScrollViewReader to programmatically scroll a horizontal scroll view. I thought it would work like scrollToItem with .centeredHorizontally in UIKit, and for the most part it does, ...
user1877760's user avatar
11 votes
2 answers
1k views

Animating Views between a LazyVGrid and an HStack with another view in between them (in this case, a Button), using matchedGeometryEffect, works great: Note how the animating views move above the ...
Ashley Mills's user avatar
  • 53.6k
10 votes
3 answers
7k views

I made a custom nav bar. and added a scroll view below it. The problem I am getting is when I scroll down, the data inside scroll view comes over the navigation bar. Here is the screenshot: My code ...
Taimoor Arif's user avatar
  • 1,230
10 votes
0 answers
2k views

I'm trying to create a carousel like some of Apple's apps. The TabView has the paged style but it doesn't "peek" at the previous and next elements. The ScrollView(.horizontal) doesn't snap. ...
TruMan1's user avatar
  • 36.6k
9 votes
4 answers
3k views

I'm trying to have the content inside a ScrollView be centered when that content is small enough to not require scrolling, but instead it aligns to the top. Is this a bug or I'm missing adding ...
andrewz's user avatar
  • 5,300
9 votes
2 answers
3k views

so I have a TabView like shown below, but when I try to implement it in a ScrollView I always have to give it a fixed height. Is there a way of telling the tabview to use the space it needs in the ...
Paul's user avatar
  • 193
9 votes
2 answers
2k views

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 ...
user avatar
9 votes
1 answer
4k views

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 ...
Mr Duck's user avatar
  • 305
8 votes
2 answers
2k views

In my chat view, each time I load new page (items are added from top), the ScrollView jumps to top instead of maintaining scrollPosition. Here is my scroll view: GeometryReader { geometryProxy in ...
ItayAmza's user avatar
  • 997
8 votes
0 answers
1k views

I'm creating an app where I'm presenting data in paged views and each view contains a vertical scrollable list, enabled by scrollView. I'm also using scrollViewReader to be able to programmatically ...
skegget's user avatar
  • 111
7 votes
5 answers
587 views

I am trying to create a day calendar view, similar to the iOS calendar app. There is a feature on the app where you can pinch the calendar to change the distance between hours, which I am trying to ...
ted's user avatar
  • 79
6 votes
5 answers
1k views

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, ...
Brian.Masse's user avatar
5 votes
1 answer
2k views

I'm needing to implement a scroll-to-top button for a ScrollView living in a NavigationStack, but when I call proxy.scrollTo() (with proxy being the ScrollViewProxy provided by ScrollViewReader), the ...
Scott Muddlegeist's user avatar
5 votes
6 answers
6k views

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, ...
blrsk's user avatar
  • 355
5 votes
1 answer
1k views

I'm trying to implement simple list with draggable cells (iOS 15). For now I have two base solutions: List and ScrollView. None of this methods doesn't lead me to appropriate result. First of all I'll ...
agoncharov's user avatar
5 votes
0 answers
282 views

I'd like to change the ScrollBar offset when tapping on a TextField in a ScrollBar which is located at the bottom (so keyboard avoidance will trigger). When I select a TextField, the ScrollBar adjusts....
leonboe1's user avatar
  • 1,185
4 votes
2 answers
6k views

I created an excel-like view, using a multi-directional scroll view. Now I want to pin the headers, not only the column headers but the row headers as well. Look at the following gif: Code I used to ...
Parag Pawar's user avatar
4 votes
2 answers
3k views

I'm new to Swift UI and I'm having troubles to make a specific UI behave the way I want. I have a ScrollView that has some content. This content in a VStack can be as small as 1-3 text components to ...
Barrufet's user avatar
  • 292
4 votes
1 answer
8k views

I have found a way to save a ScrollViews offset with a GeometryReader and a PreferenceKey. SwiftUI | Get current scroll position from ScrollView And the ScrollViewReader has a method scrollTo to ...
L3n95's user avatar
  • 1,655
4 votes
1 answer
5k views

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 ...
Ben Frearson's user avatar
4 votes
2 answers
3k views

Based off of this question: SwiftUI - Drawing (curved) paths between views I draw the needed views and paths using the GeometryReader. The problem is, now it becomes too long for the screen to show it ...
Big_Chair's user avatar
  • 3,279
4 votes
1 answer
437 views

When you turn the ScrollView left to right, and try to scroll, content jumps to the other side. Is there any way to prevent this? Main: var body: some Scene { WindowGroup { ContentView() ...
Metin Atalay's user avatar
  • 1,525
4 votes
1 answer
1k views

I’m trying to show a list of pictures in my app using ScrollView and .scrollTargetBehavior(.paging) modifier. But when swipe to next page, the view does not start at the beginning of the next image, ...
Doraemoe's user avatar
  • 321
4 votes
2 answers
2k views

I want to use a simple horizontal ScrollView as NavigationLink inside a List. However, tapping on the ScrollView is not registered by a NavigationLink and therefore does not navigate to the ...
damirstuhec's user avatar
  • 6,217
4 votes
3 answers
768 views

The scroll position is not updated when orientation changes in a ScrollView with .scrollTargetBehavior(.viewAligned) and .scrollPosition(). import SwiftUI struct ContentView: View { let colors: [...
clns's user avatar
  • 2,354
4 votes
0 answers
3k views

Problem Outline: What I set out to build I'm trying to build some sort of reader app and I'm running into severe performance issues with several approaches. If you know how to do this, please read the ...
Principled's user avatar
4 votes
0 answers
1k views

I am working on a feature for my app which will allow user to dictate text which will appear in a textField. For that I created a scrollView with only a textField which contents are automatically ...
Mikolaj's user avatar
  • 136
4 votes
1 answer
3k views

I'm trying to make the scroll reset to the top of the page when a view appears (e.g. when you navigate back from a navigation link). The ScrollView is embedded within a NavigationView with a large ...
sia's user avatar
  • 366
3 votes
1 answer
4k views

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 {...
soleil's user avatar
  • 13.3k
3 votes
1 answer
3k views

I have prepared a simple example. If you tap on the button, a sheet will be presented containing the CustomSheetView. Do not behalf on the design itself it is more about the scrolling behaviour. If I ...
Dgotin's user avatar
  • 68
3 votes
2 answers
1k views

I have created a horizontal carousel using a ScrollView with an HStack. This is my code: struct CarouselView<Content: View>: View { let content: Content private let spacing: CGFloat ...
Shawn Frank's user avatar
  • 5,303
3 votes
1 answer
3k views

I have a horizontal scrollView which shows a bunch of images from a dynamic image array. When the total content width is greater than the screen width everything is fine. However if say there is ...
alionthego's user avatar
3 votes
5 answers
2k views

I have a NavigationStack that contains a ScrollView at the bottom of the screen. struct ContentView: View { var body: some View { NavigationStack { VStack { ...
Sweeper's user avatar
  • 292k
3 votes
3 answers
629 views

I have a horizontal scroll user experience with a ScrollView and an HStack. I wanted to figure out a way to realize that the user has reached the end of the HStack. To accomplish that, I used this ...
Shawn Frank's user avatar
  • 5,303
3 votes
1 answer
865 views

I would like to achieve attached gif effect in swiftUI, i have tried to make use of several ways to get it to work with no success. When scrolling up the buttons must fade and then once the switcher ...
kaddie's user avatar
  • 293
3 votes
0 answers
1k views

I have a ScrollView that will support infinite scroll (it’s a calendar), and so I’m using a LazyVStack for its contents. I need to know at all times what the first visible item is. To be clear, as ...
Barrrdi's user avatar
  • 1,211
3 votes
0 answers
2k views

thank you for helping me with the following issue. The Overall Goal I work on a SwiftUI view that contains a scrollable area to present some data. Assume it should display natural numbers within a ...
Marc Schmidt's user avatar
3 votes
0 answers
2k views

With Swiftui 3 Apple added modifier refreshable. I can use it with List. But if I have scrollview it doesn't work. Any ideas? ScrollView(.vertical) { LazyVGrid(columns: columns, spacing: ...
David Olejnik's user avatar
3 votes
0 answers
2k views

In SwiftUI, I have a Button that's underneath the Spacer within a ScrollView. The ScrollView steals the tap gesture, so the Button never sees the tap. So, for example, the button in this example does ...
drewster's user avatar
  • 6,180
3 votes
0 answers
342 views

I'm having some issues surrounding disabling keyboard avoidance in SwiftUI. My app has a custom tab bar which sits in a VStack underneath the content of the root view. However, most of my views have ...
jed-boffey's user avatar
3 votes
1 answer
891 views

I have a view which contains a button. The view with the button is created from a forEach loop. For some reason only some buttons are tappable and others are not. The parent view contains a ...
Taylor Simpson's user avatar
3 votes
0 answers
932 views

Im trying to get the current month when the calendar is being scrolled. My goal is to have the header with the current month, then when the view is scrolled down to a new month the header updates ...
Carterman's user avatar
  • 239
3 votes
1 answer
4k views

I want a large title in the navigationbar on a pushed view in SwiftUI and an inline title on the parent view. When the parent navigation bar display mode is not set, it works: Working without display ...
thekakami's user avatar
2 votes
1 answer
969 views

I am developing a cross platform app in SwifUI. On iPhone / iPad this code works really well on MacOS instead when I insert a NavigationLink the ForecastCardView is totally cut off. When I remove the ...
Salvatore Milazzo's user avatar
2 votes
1 answer
2k views

I am trying to create a horizontal carousel using SwiftUI ScrollView This is what I have done so far: struct CarouselView<Content: View>: View { let content: Content @State private var ...
Shawn Frank's user avatar
  • 5,303
2 votes
4 answers
3k views

I am currently struggling on my ChatView of my app. This is a sample code of what i want to achieve. It has functionality such as when the user is about to reach the top it fetches older messages and ...
Franky11's user avatar
  • 105
2 votes
1 answer
1k views

I tried to make a horizontal scrollview that contained a list of item. when I clicked any of the item, it will show a border(highlight) behind the item. When I press another item, the previous border ...
Oxford212's user avatar
  • 139
2 votes
1 answer
243 views

I have an issue with @AppStorage and ScrollViewReader that seems like a bug. My @AppStorage variable fontSize is supposed to adjust the text size inside a ScrollViewReader. However, when its value ...
soundflix's user avatar
  • 3,133

1
2 3 4 5