Skip to main content
Filter by
Sorted by
Tagged with
2 votes
1 answer
4k views

I am developing an application with swiftui. After zooming, when I say scroll to the corner with the ScrollViewReader, it goes out of the screen. my code is below. It fails after trying a few times. ...
ursan526's user avatar
  • 545
2 votes
3 answers
3k views

I have a SwiftUI app which supports both LTR and RTL languages. It is not fixated to either one of those, it just depends on what user wants. I have a horizontally scrollable list of things inside a ...
hvkale's user avatar
  • 17.8k
1 vote
1 answer
936 views

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 ...
unknown's user avatar
  • 1,038
2 votes
2 answers
2k views

I am able to print scrollview content height based on the below code when the countvalue is static struct ContentView: View { @State var countValue : Int = 1000 var body: some View { ...
Maharajan S's user avatar
1 vote
1 answer
245 views

I have centered my Scroll View by using GeometryReader like this: struct ContentView: View { var body: some View { NavigationView { GeometryReader { geom in ...
Isaac's user avatar
  • 508
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
1 vote
1 answer
957 views

I am trying to scale a view horizontally using scaleEffect and MagnificationGesture. It is almost working as I want with the exception that the ScrollView does not resize when its child view resizes. ...
Isaak's user avatar
  • 1,379
0 votes
1 answer
601 views

I am trying to zoom a view horizontally using UIScrollView. My code almost gives me what I want except that it also scales the view vertically. What I want to achieve is that the image only gets ...
Isaak's user avatar
  • 1,379
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
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
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
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
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
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
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
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
0 votes
0 answers
1k views

I just can't seem to get rid of the ~6 height padding(?) at the top of ScrollView. I've tried setting padding to 0 on both the ScrollView itself and on it's content. I've tried using SwiftUI-...
user1877760's user avatar
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
2 votes
1 answer
8k views

I have built a Chips Container based on this link. Basically is just a container that orders chips in rows. This is my code: struct ChipsContent: View { @ObservedObject var viewModel = ...
Dani Garcia's user avatar
1 vote
2 answers
444 views

I want to build a menu like the image bellow where I can scroll between menus. I did try multiple combinations with HStack/VStack in ScrollView and rotation modifier on Text and/or stacks. However, ...
Hans Rietmann's user avatar
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
1 vote
2 answers
5k views

I am building an app as a learning project. I ran into a problem, where one of my tabs scrolls vertically and horizontally for no reason. There is no content outside the safe-area, and i can´t think ...
AC40's user avatar
  • 11
2 votes
0 answers
521 views

I want to zoom in on a specific element in the scrollview. I want it to be an anchor center. When zooming to the upper left elements, no problem, it works properly. But when you zoom in on the top ...
ursan526's user avatar
  • 545
0 votes
1 answer
1k views

How can I have a Form with one element in the Form taking up the full screen width? I tried putting the Form into a ScrollView but then there are other issues and it might not be a good idea to nest 2 ...
Isaak's user avatar
  • 1,379
0 votes
1 answer
824 views

I've been trying to create a TabView with PageIndexViewStyle where each page is a ScrollView that contains an image and a WebView. The example code here from @Asperi works great when I'm creating a ...
sia's user avatar
  • 366
0 votes
1 answer
2k views

It seems like the EditButton() in SwiftUI (Xcode 12.5 beta 3) has various issues. In my code, everything was working fine until I replaced the List with a ScrollView and added a LazyVGrid. Now, when a ...
FPL's user avatar
  • 466
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
1 vote
1 answer
263 views

I can't make many .scrollTo() in my code: (I'm French sorry for my bad english) else if index == 1 { withAnimation { value.scrollTo(topID) } } my issue is in value.scrollTo(topID)...
Name's user avatar
  • 11
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
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
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
2 votes
1 answer
580 views

Tap gesture on green does not work. Does anyone have a solution for this? ZStack { Color.green .onTapGesture { print("green") } ScrollView { ...
NikaE's user avatar
  • 622
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
1 vote
1 answer
3k views

I'm developing MacOS App with SwiftUI. Let's say we have a fixed size window, which will show a scrollable image. Now I want to create a feature which can let user to scale the image, and can scroll ...
Yuqi Jin's user avatar
2 votes
1 answer
681 views

I have following code. Two big buttons at the top and a ScrollView with many buttons below: struct ContentView: View { var body: some View { VStack (spacing: 0) { HStack (...
L3n95's user avatar
  • 1,655
1 vote
0 answers
447 views

Inside of a Scrollview I use a LazyVStack with a pinned header, and based on the scroll position I manipulate the scale of that header. In the LazyVStack, I have a ForEach iterating over some list of ...
bze12's user avatar
  • 803
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
0 votes
1 answer
504 views

SwiftUI Horizontal ScrollView item becomes invisible when scrolled in iOS 14.3 but works fine in iOS 13 GeometryReader { geometry in ZStack (alignment: .center) { ...
Adeyemi Seun's user avatar
1 vote
0 answers
2k views

I wonder how to determine if the content inside ScrollView is fully visible without scrolling? ScrollView { LazyVStack { PlainButton("1") PlainButton("2") PlainButton("...
eugene_prg's user avatar
  • 1,228
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
2 votes
2 answers
1k views

I need to place a translucent rectangle on front of ScrollView but when i put everything (Rectangle & ScrollView) inside of a ZStack, scroll & touch events stop working within this rectangle. ...
eugene_prg's user avatar
  • 1,228
0 votes
0 answers
118 views

I have a SwiftUI modal view that consists of a scroll view, and implements the scrollTo functionality perfectly the first time it is presented. The functionality breaks all subsequent times it is ...
David Baez's user avatar
  • 1,248
1 vote
0 answers
246 views

I am using the following code to create a horizontal scroll view with negative spacing (I'm using negative spacing so the items in the stack overlap). Whenever my app is in a small window and I ...
Evan Kaminsky's user avatar
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
0 votes
0 answers
372 views

I have a map that I want to put into my app, and I am currently learning SwiftUI. I want to put in an SVG where I can scroll, zoom, set initial x & y coordinates / initial zoom, max zoom, and tap ...
shepsheepie's user avatar
1 vote
1 answer
425 views

I am trying to read location in DragGesture of a View connected to a ScrollView, but ScrollView take control of DragGesture on all view and does not let me to read those information. Here is my ...
user avatar
0 votes
1 answer
226 views

does anyone have an idea how can i break Vertical ScrollView into small horizontal ScrollView using SwiftUi: I have the code bellow which displays the youtubeResults vertically, since each item of ...
Lost in Clouds's user avatar
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
2 votes
1 answer
6k views

I built a simple horizontal calendar with SwiftUI and it works fine. But I want that it automatically scroll to the current date at app launch. How can I do this? I assume I should use GeometryReader ...
SunnyBunny27's user avatar
0 votes
1 answer
3k views

I have set my TaskElement model to be an environmentObject to be able to edit tasks. I did like this to be able to edit tasks on the same page to create a new task. Which is called NewTaskView. Btw, I ...
Mert Köksal's user avatar