209 questions
0
votes
0
answers
44
views
SwiftUI .refreshable causes misaligned button tap targets in ScrollView
I have a ScrollView with several Buttons and a .refreshable modifier. As soon as I pull to refresh and the refresh indicator appears, the tap targets no longer match the visible button positions. For ...
0
votes
1
answer
87
views
How to make a Button work inside a ScrollView but outside of the ScrollView's bounds in SwiftUI?
I observed a weird behavior and I believe it's a bug in SwiftUI but maybe it's not or someone knows a way to fix it.
By default, overlays have the same size as the view they are attached to in SwiftUI....
0
votes
1
answer
52
views
How to use a button to change the position of ForEach generated views using ScrollView and the .scrollPosition modifier [closed]
I'm trying to create a paginated text element that loads strings from a simple array (of unknown range), which can be navigated through using a 'next' button.
Think of character dialogue boxes in old-...
1
vote
1
answer
131
views
How to synchronize the scroll position between two repeating, scrollable views?
I am trying to recreate this view from an app. essentially its two repeating/infinite scrollable views. the top contains the days of the week, and the bottom is a paging view that shows the classes on ...
3
votes
5
answers
2k
views
ScrollViews at the bottom of NavigationStack cause the navigation title to be invisible in iOS 26
I have a NavigationStack that contains a ScrollView at the bottom of the screen.
struct ContentView: View {
var body: some View {
NavigationStack {
VStack {
...
0
votes
0
answers
69
views
Form Items inside scrollview randomly stops being clickable
I need view like this in order to have fixed size form with scrollable capability.
I have disclosure groups, buttons and textfields inside form.
struct ContentView: View {
var body: some View {
...
0
votes
1
answer
84
views
Scrollable list items flicker when keyboard is dimissed
In code below, when the list has more items than can fit on the screen, when the keyboard is dismissed the list items flicker, appear jittery. I have not been able to find a solution. I suspect ...
0
votes
2
answers
239
views
SwiftUI ScrollView scrollTargetLayout not working
I have the following scrubber implementation in SwiftUI. The + button is supposed to move the ScrollView up by 1 tick (or scrollPosition incremented by 1) but the issue is no scrolling happens until I ...
1
vote
1
answer
80
views
List cannot scroll vertically If hovered a List subview that needs to support horizontal scrolling
I have a List that contains some views, some of which need horizontal scrolling. It is important to note that none of the views require vertical scrolling. When my mouse hovers over the views that do ...
0
votes
3
answers
157
views
How to round the corners of a ScrollView without affecting indicators?
In my code, I want the indicators to not have a background but still be included in my UI. Therefore, I want this layout, but it has an issue—I cannot clip the ScrollView to remove those four extra ...
1
vote
0
answers
64
views
TabView views only show when I remove the ScrollView. But I need the ScrollView for my complex UI, so how do I fix this?
TabView views only show when I remove the ScrollView. But I need the ScrollView for my complex UI, so how do I fix this?
ScrollView {
VStack {
if showDivider {
Divider(...
0
votes
1
answer
423
views
Get optimized ScrollView value IOS
I need to get the ScrollView value, and I already have one solution, but it's not very optimized. And I have a strong feeling that I'm missing a simpler solution. My final goal is get the ScrollView ...
3
votes
1
answer
4k
views
SwiftUI scrollview sticky header without using List
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 {...
1
vote
0
answers
143
views
No tap animation when pressing a Button inside a ScrollView with SwiftUI
I am writing an application and have a structure similar to the following:
ScrollView {
VStack {
Button(action: {
print("hello")
}) {
Text("...
0
votes
0
answers
62
views
Prevent or detect scrolling by dragging of scroll indicator
In our app, we display a large list of items (roughly 30000 items) whereby each item needs to convert a complex/long string with tags into a NSAttributedString which is then displayed. We have ...
2
votes
4
answers
3k
views
Preserve Scroll Position in ScrollView when Adding New Items
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 ...
0
votes
0
answers
143
views
Issues with displaying Images in SwiftUI
I have an issue with loading Images from SwiftData or from Disk (Directory Folder) into a SwiftUI View.
In the below example is the ScrollView with the LazyVGrid loading Images from SwiftData - (...
0
votes
0
answers
73
views
Dynamic resizing within ScrollView with limited maxWidth and maxHeight for one component and flexible for another?
I'm working with a vertical ScrollView in SwiftUI, and I want to have dynamic resizing for two components inside it. Specifically, I want one component to have a constrained maxWidth and maxHeight (up ...
1
vote
2
answers
213
views
Swiftui Bug - Button (only top part is clickable)
I'm having an issue with SwiftUI where only the top part of the button is clickable, while the bottom part is not clickable at all.
Here is my code snippet. Does anyone know how I can fix this?
struct ...
4
votes
2
answers
3k
views
ScrollView takes the entire height when content is small
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 ...
1
vote
2
answers
1k
views
How can I make elements appear at the bottom of a ScrollView?
I have a SwiftUI related question. I'm trying to make a chat and make messages appear at the bottom of the screen (like at the screen from Telegram). All solutions I tried keep rendering messages at ...
0
votes
1
answer
233
views
Scroll jump in SwiftUI when using two LazyVGrids in a single ScrollView
In my project I have two LazyVGrids inside the same ScrollView, which are dynamically loading content: pages of the first grid are requested every time the user is reaching the end, and when all the ...
0
votes
0
answers
224
views
NavigationStack crashes when poping scrolling view on iOS 16
Investigating strange navigation bug in my iOS app.
I'm using NavigationStack for push-navigation and a dedicated ObservableObject Communicator which holds current NavigationStack's path.
What I want ...
0
votes
2
answers
1k
views
SwiftUI - Allow List to Show All Rows in ScrollView
In the app I'm working on I have a details view that uses ScrollView to display a bunch of information. I want to use a List inside that ScrollView to display some specific data. However, you can't ...
0
votes
0
answers
397
views
SwiftUI ScrollView has weird behavior when reseting the content
I'm working with SwiftUI and trying to do a ScrollView that can be filtered (it's basically a list).
The stack looks like this:
class ViewModel: ObservableObject {
@Published
var isRefreshing =...