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
0
votes
1 answer

Moving Horizontal ScrollView up top SwiftUI

I am trying to move the images in Horizontal ScrollView up top. They are currently at the bottom. I have tried adding NavigationView, .padding(), Spacer(), Adding a ZStack as a parent to HStack, and HStack(alignment: .top). I have been stuck for 3…
0
votes
0 answers

SwiftUI extend or recalculate VStack height when children views extend

I have a scrollview that holds "cards" with weather details of locations and the cards extend to show more information when tapped. I have to use a LegacyScrollView so that the bottomsheet that encompasses the scrollview gets dragged down when the…
0
votes
1 answer

Swiftui ScrollView is affected unexpectedly by scaleEffect modifier

I have some views with many details with fixed sizes, and am trying to use scaleEffect() to reduce them proportionally to fit better smaller devices. However, when using scaleEffect() on a ScrollView, I noticed that it has a larger effect than…
jo'taH
  • 1
0
votes
1 answer

SwiftUI ForEach nested in ScrollView breaks onPreferenceChange

I am trying to get the current scroll value of a ScrollView to be used elsewhere in other views. It appears the only way to do it is using GeometryReader and store its value in a PreferenceKey to be then read by onPreferenceChange so that we do not…
jalone
  • 1,953
  • 4
  • 27
  • 46
0
votes
1 answer

How to get index value of a scrollview at certain position?

I have a horizontal scrollview like below with V as an overlay and it acts like a pointer: V [ 0 ] , [ 1 ] , [ 2 ] , [ 3 ] , [ 4 ] , [ 5 ] ^ When I scroll, I would like to print the value or index that is in the current pointer. Eg. scroll…
0
votes
1 answer

How Do i maintain Scrollview subitem height with Swiftui

I am new to swift and I am trying to wrap my view in Scrollview. The issue is that, when I wrap the content in the scrollview, the contents shrink. I have the images below. sample code: ScrollView(.vertical) { GeometryReader { metrics in …
Joseph Ofem
  • 304
  • 2
  • 15
0
votes
1 answer

How to capture touch events from a UIScrollView when user is scrolling the screen vertically on iOS with Swift?

I'm new to the iOS development and Swift and I have the following problem: I would like to capture touch events from the screen. I have no problems with doing this on regular views. Unfortunately, I encountered issues with the UIScrollView…
Piotr Wittchen
  • 3,853
  • 4
  • 26
  • 39
0
votes
1 answer

SwiftUI/UIKit: Horizontal ScrollView to scale view

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 scaled in the horizontal direction and that the…
Isaak
  • 1,107
  • 2
  • 11
  • 29
0
votes
0 answers

Getting rid of SwiftUI ScrollView top padding

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-Introspect to get at the content insets, but they appear…
user1877760
  • 263
  • 2
  • 9
0
votes
2 answers

SwiftUI View scrolls horizontal and vertical as well, instead of scrolling only vertically

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 of a reason for it to be scrolling sideways. I…
AC40
  • 1
  • 1
  • 2
0
votes
1 answer

SwiftUI Full Screen Width Content Within Form

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 scrolling views. struct ContentView: View { …
Isaak
  • 1,107
  • 2
  • 11
  • 29
0
votes
1 answer

Embedding webview within a tabview in SwiftUI

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 page outside of the TabView, but when I move things…
sia
  • 256
  • 3
  • 14
0
votes
1 answer

EditButton() in SwiftUI inside a ScrollView / LazyVGrid

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 user taps on the EditButton, EditMode is not…
FPL
  • 456
  • 4
  • 21
0
votes
1 answer

SwiftUI Horizontal ScrollView item becomes invisible when scroll in iOS 14.3 but works fine in iOS 13

SwiftUI Horizontal ScrollView item becomes invisible when scrolled in iOS 14.3 but works fine in iOS 13 GeometryReader { geometry in ZStack (alignment: .center) { Color(UIColor(hexString: "#F2F2F7")) …
Adeyemi Seun
  • 111
  • 9
0
votes
0 answers

SwiftUI View scrollTo behaves differently second time presented

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 presented. Any reason why this behavior may be…
David Baez
  • 1,208
  • 1
  • 14
  • 26
1 2 3
8
9