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

SwiftUI ScrollView won't scroll when using fixedSize() to keep text from truncating

While trying to create a ScrollView with text inside it, my text was truncating so that it never expanded beyond the height of the view. While googling the issue, I found the solution of including .fixedSize(horizontal: false, vertical: true) on…
Cam Crain
  • 49
  • 5
0
votes
0 answers

how to better implement reverse infinite scroll for conversation like screens

In a chat-like app, the newest messages are shown at the bottom of the list. As you scroll up, the older messages are loaded and displayed, similar to the endless scrolling we’re accustomed to. There are several options available to match this use…
AbdelAli
  • 796
  • 1
  • 6
  • 6
0
votes
1 answer

Why does ScrollView randomly push my views content downwards?

Here is my code: import SwiftUI struct TrendingView : View { @State var selectedTab: Tabs = .hot @State private var searchText = "" var body: some View { NavigationView { …
0
votes
1 answer

Why is ScrollView ignoring the shadow of the header?

I am trying to use a custom made header for a view and the child views of the ScrollView seem to ignore the shadow and go over top of it. Is there a simple fix or should I set up the all the Views in a different way? I have tried rearranging the…
0
votes
1 answer

Horizontal Drag Gesture on Vertical ScrollView

I have an app similar to most with a main view that scrolls vertically. On top of that, I have a horizontal drag gesture to pull out a side menu. The issue I am running into when trying to drag the menu open is any vertical movement at all stops the…
RealCasually
  • 3,593
  • 3
  • 27
  • 34
0
votes
0 answers

How to fix alignment in ScrollView in SwiftUI with ([.horizontal, .vertical]) configuration. Alignment breaks when fast scrolling done

I have a SwiftUI view that contains ScrollView with ([.horizontal, .vertical]) attribute. I want to show pinned headers in the horizontal and vertical stack views, inside ScrollView. So I am using LazyVStack and LazyHStack. But when I am scrolling…
Fauad Anwar
  • 91
  • 2
  • 3
0
votes
1 answer

SwiftUI UISearchController replacement: search field, results and some scrollable content fail to coexist in a meaningful manner

Starting with this var body: some View { ScrollView { VStack(spacing: 0.0) { Some views here } } .edgesIgnoringSafeArea(.top) } How would I add List(suggestions, rowContent: { text in …
0
votes
0 answers

Scroll conflict when there is ScrollView inside a ScrollView in SwiftUI

I'm trying to reproduce in a way the finder column view, but I'm facing an issue. A scroll conflict occurs when I put a ScrollView or a List inside another ScrollView. The horizontal scroll is lagging when the cursor is over the nested…
0
votes
0 answers

SwiftUI How can I center a horizontal scroll view in screen?

I'm developing a camera application with SwiftUI and I need to create a component similar to this one I have the next code ScrollViewReader { proxy in ScrollView(.horizontal) { HStack(alignment:…
Dani Garcia
  • 464
  • 1
  • 6
  • 18
0
votes
1 answer

In SwiftUI, supporting iOS 14 and above, how do I get a ScrollView child view to ignore the safe area

I have a VStack that contains a Rectangle. The Rectangle has an edgesIgnoresSafeArea(.top) view modifier on it to extend it through the top safe area. import SwiftUI struct ScrollViewSafeArea: View { var body: some View { ScrollView…
FStrout
  • 29
  • 5
0
votes
0 answers

Scrollview is not starting at the top, and a grey area at the top

I'm building a app but the layout is not perfect yet. I have some problems with the navigationmenu and the scrollview. First of all the scrollview begin about 20/40 px below the top (see the 2 pictures) Also I see a grey top (see second picture),…
BouBal
  • 25
  • 4
0
votes
0 answers

How to get the height of a dynamic View in SwiftUI?

Working on a project where view are aligned like this HeaderView TabView Views with each tab List and other items in each view Relevant code is struct Home: View { @StateObject var manageScrollPosition = ManageScrollPosition() var body: some View…
0
votes
0 answers

Set height of ScrollView to height of content

I want the scrollView to be exact the size of its content. But if I don't set a fixed size (".frame(height: 300)"), it looks like this: Instead it should have the height of its content. This is my code: var body: some View { ScrollView{ …
Pjaks
  • 251
  • 1
  • 11
0
votes
0 answers

Why does ScrollView not scroll to bottom?

RoomView.swift ScrollViewReader { proxy in ScrollView { VStack { LazyVGrid(columns: twoColumnGrid, alignment: .leading) { ForEach(roomData.newItems, id: \.id) { item in …
user7894007
0
votes
1 answer

Is there any way to find out the position on screen of a SwiftUI ScrollView item?

I have a SwiftUI ScrollView that contains a LazyVStack of tappable elements. When I tap on an element I wish to display a small popover at a position relative to that of the tapped element, regardless of the ScrollView offset. The popover position…
Robin Macharg
  • 1,468
  • 14
  • 22
1 2 3
8 9