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
0 answers

Issue with Scrolling contents of List in SwiftUI

I have some Content inside a SwiftUI list. There is also a NavigationLink(destination, Label) wrapped around the content to let the user navigate to the Detail View when the List Item is clicked. However, I'm unable to scroll the List unless I…
Amey079
  • 131
  • 7
0
votes
0 answers

TabView where one of the tabs is a ScrollView is glitchy?

I'm having some weird glitches when trying to have a ScrollView as one of my tab-views. This is my sample code: import SwiftUI struct ContentView: View { // hack to set unselected tab item color init() { …
irrbloss
  • 207
  • 2
  • 9
0
votes
2 answers

SwiftUI ForEach block takes more space if there is only one item

When I use this block of code, I want ScrollView and ForEach views to expand when new items are added to ForEach view. But currently it just fills some space that is larger than the view inside ForEach block. How can I make it fill space for only…
zigmuntb
  • 15
  • 3
0
votes
1 answer

SwiftUI: Hiding tabBar and navigationBar on scroll

I have a complex view that includes a ScrollView and I'm trying to hide both the tabBar and the navigationBar whenever the user starts scrolling, and show them again when the user stops scrolling (kind of like in the Apollo iOS for Reddit…
noloman
  • 11,411
  • 20
  • 82
  • 129
0
votes
1 answer

Prevent ScrollView from Shrinking Content SwiftUI

I have a Horizontal ScrollView with some Content received from an API. However, when I scroll the Content, after a certain amount of Scrolling, the content shrinks. Is there a way to prevent this? The 2nd Image shows the content Shrinking after…
Amey079
  • 131
  • 7
0
votes
0 answers

Conundrum; Overlay disables button tapping. Setting .allowsHitTesting(false) disables underlying gestures

I have a nasty problem: I use a custom ViewModifier to be able to zoom (pinch) and pan an Image. On that Image I place pins on positions relative to that image. Those pins are buttons and need to be tap-able. However, the ViewModifier puts an…
0
votes
1 answer

Pin symbols to a pan and zoomable Image @ fixed location. Pins incorrectly placed when zoomed in

I want to be able to place pins (symbols for now) on a user selected Image. The image should be pan-able and zoomable. The pins should stick to their location (pixels) relative to the underlying image. I got this working using a ScrollView by way of…
0
votes
1 answer

SwiftUI: How to scroll a list inside a sheet without dragging the sheet to the top

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 want to scroll the list at first the sheet will…
0
votes
0 answers

ScrollView Pagination continuously

I want make pagination with scrollview. it has another choice like TabView with rotationEffect but, it has a fundamental problem with ignoreSafeArea in my case. here's my code import SwiftUI struct GalleryView: View { var selected:…
Martin Q
  • 7
  • 2
0
votes
0 answers

How to make ScrollView fill only size of child?

I have the following situation: I need to display a sheet with the items user can pick. Since the amount of this items can be big, I added the ScrollView to display the items. Here's the way I implemented the sheet: struct PickerModalView: View { …
Sergei Mikhailovskii
  • 2,100
  • 2
  • 21
  • 43
0
votes
0 answers

SwiftUI ScrollView Position remains the same when List is updated

I want to use ScrollView and ForEach to show elements in the list of Post. Every time when the scrollbar reach to the top of the ScrollView, i'm gonna try to query more Posts and update the list. When i use PullToRefresh and getPostsBeforeIndex() to…
JasmY
  • 1
  • 1
0
votes
0 answers

How to animate with .scaleEffect on an image in a ScrollView exclusively when the image is in the center of the screen?

I am using SWIFTUI for iOS16 development of an app. My app is in landscape mode only, and I have a ScrollView horizontal, in the middle of the screen. The ScrollView works fine, however I would like to add a beautiful animation effect so that when…
Pro Girl
  • 762
  • 7
  • 21
0
votes
0 answers

Is there any way in SwiftUI to identify in a ListView which row is currently at a given position of a view

I wanted to provide a zooming effect to the images displayed in a ListView. Each time the list scrolls up & the item reaches top of my visible area. I want to zoom the image a little.
0
votes
2 answers

Update only a child view within SwiftUI body

I have a LottieAnimationView along with some other components inside ScrollView, animation is only supposed to play once. @State var messageBannerVisisbility: Bool = false var body: some View { VStack(alignment: .center) { …
Paras Gorasiya
  • 1,295
  • 2
  • 13
  • 33
0
votes
1 answer

Having multiline text in a horizontal scroll view in SwiftUI

I want to make a UI that loads an array of strings into a scrollable horizontal stack. The texts however should have a max width of 100, and expand to be multiline to fill the space. This works, however the text is cut off and the horizontal…
Priva28
  • 327
  • 1
  • 10
1 2 3
8 9