Close Menu
  • Home
  • AI
  • Big Data
  • Cloud Computing
  • iOS Development
  • IoT
  • IT/ Cybersecurity
  • Tech
    • Nanotechnology
    • Green Technology
    • Apple
    • Software Development
    • Software Engineering

Subscribe to Updates

Get the latest technology news from Bigteetechhub about IT, Cybersecurity and Big Data.

    What's Hot

    Memorial Day Tech Deals: Sony, Anker, Beats (2026)

    May 25, 2026

    ios – SwiftUI ScrollView shuffles visible content when appending paginated items mid-scroll

    May 25, 2026

    Azure IaaS: Deploy high-performance workloads with a system-level approach

    May 25, 2026
    Facebook X (Twitter) Instagram
    Facebook X (Twitter) Instagram
    Big Tee Tech Hub
    • Home
    • AI
    • Big Data
    • Cloud Computing
    • iOS Development
    • IoT
    • IT/ Cybersecurity
    • Tech
      • Nanotechnology
      • Green Technology
      • Apple
      • Software Development
      • Software Engineering
    Big Tee Tech Hub
    Home»iOS Development»ios – SwiftUI ScrollView shuffles visible content when appending paginated items mid-scroll
    iOS Development

    ios – SwiftUI ScrollView shuffles visible content when appending paginated items mid-scroll

    big tee tech hubBy big tee tech hubMay 25, 2026002 Mins Read
    Share Facebook Twitter Pinterest Copy Link LinkedIn Tumblr Email Telegram WhatsApp
    Follow Us
    Google News Flipboard
    ios – SwiftUI ScrollView shuffles visible content when appending paginated items mid-scroll
    Share
    Facebook Twitter LinkedIn Pinterest Email Copy Link


    I have a long home feed built as a SwiftUI ScrollView containing a VStack of sections. The last section is paginated when the user scrolls near the bottom, I fetch the next page and append rows to that section’s data array.

    Once there is a large amount of content above the paginated section, scrolling slowly through the paginated section causes the visible rows to shift/replace under the finger when a new page is appended as if the content is “refreshing” while stationary. The scroll offset itself does not reset (I logged it, it climbs monotonically), but the visible rows visibly jump.

    The jump only appears when the content above the paginated section is tall (in my real app these are several horizontally-scrolling recommendation carousels). With little content above, it’s not noticeable. Replacing the outer VStack with LazyVStack reduces/hides the jump, which makes me suspect it’s related to how content size is re-measured on append.

    1. Is this a known ScrollView behavior when contentSize grows during scroll?

    2. Is there a supported way to keep the visible content anchored across an append (e.g. scrollPosition, defaultScrollAnchor, .geometryGroup()), without migrating the whole screen to List?

    3. Does LazyVStack “fixing” it indicate the root cause is eager content-size re-measurement, or is it just masking the symptom?

    import SwiftUI
    
    struct ContentView: View {
        // Simulates tall content above the paginated section
        let headerBlocks = Array(0..<8)
    
        @State private var items: [Int] = Array(0..<20)
        @State private var isLoading = false
    
        var body: some View {
            ScrollView {
                VStack(spacing: 0) {
    
                    // --- Tall content above (the trigger condition) ---
                    ForEach(headerBlocks, id: \.self) { block in
                        // A horizontal carousel, like a "recommendations" row
                        ScrollView(.horizontal, showsIndicators: false) {
                            HStack(spacing: 12) {
                                ForEach(0..<10, id: \.self) { _ in
                                    RoundedRectangle(cornerRadius: 12)
                                        .fill(.gray.opacity(0.3))
                                        .frame(width: 160, height: 120)
                                }
                            }
                            .padding(.horizontal)
                        }
                        .frame(height: 130)
                        .padding(.vertical, 8)
                    }
    
                    // --- Paginated vertical section ---
                    LazyVStack(spacing: 16) {
                        ForEach(items, id: \.self) { item in
                            RoundedRectangle(cornerRadius: 12)
                                .fill(.blue.opacity(0.2))
                                .frame(height: 90)
                                .overlay(Text("Item \(item)"))
                                .onAppear {
                                    // Trigger near the end
                                    if item == items.count - 2 {
                                        loadMore()
                                    }
                                }
                        }
                    }
                    .padding()
                }
            }
        }
    
        private func loadMore() {
            guard !isLoading else { return }
            isLoading = true
            // Simulate network append
            DispatchQueue.main.asyncAfter(deadline: .now() + 0.3) {
                let next = items.count
                items.append(contentsOf: next..<(next + 20))
                isLoading = false
            }
        }
    }
    



    Source link

    appending Content iOS Items midscroll paginated ScrollView shuffles SwiftUI visible
    Follow on Google News Follow on Flipboard
    Share. Facebook Twitter Pinterest LinkedIn Tumblr Email Copy Link
    tonirufai
    big tee tech hub
    • Website

    Related Posts

    ios – App Store search indexing lost after submitting a new binary. App accessible via direct link but not appearing in search results

    May 24, 2026

    ios – How to programmatically retrieve iPhone battery health and device color in C# / .NET?

    May 23, 2026

    Meta releases Forum, a Reddit-like standalone app for Facebook Groups, with a feed showing Group conversations and an AI-powered “Ask” feature, on iOS (Mariella Moon/Engadget)

    May 22, 2026
    Add A Comment
    Leave A Reply Cancel Reply

    Editors Picks

    Memorial Day Tech Deals: Sony, Anker, Beats (2026)

    May 25, 2026

    ios – SwiftUI ScrollView shuffles visible content when appending paginated items mid-scroll

    May 25, 2026

    Azure IaaS: Deploy high-performance workloads with a system-level approach

    May 25, 2026

    Moving past size in nanoplastics research

    May 24, 2026
    Timer Code
    15 Second Timer for Articles
    20
    About Us
    About Us

    Welcome To big tee tech hub. Big tee tech hub is a Professional seo tools Platform. Here we will provide you only interesting content, which you will like very much. We’re dedicated to providing you the best of seo tools, with a focus on dependability and tools. We’re working to turn our passion for seo tools into a booming online website. We hope you enjoy our seo tools as much as we enjoy offering them to you.

    Don't Miss!

    Memorial Day Tech Deals: Sony, Anker, Beats (2026)

    May 25, 2026

    ios – SwiftUI ScrollView shuffles visible content when appending paginated items mid-scroll

    May 25, 2026

    Subscribe to Updates

    Get the latest technology news from Bigteetechhub about IT, Cybersecurity and Big Data.

      • About Us
      • Contact Us
      • Disclaimer
      • Privacy Policy
      • Terms and Conditions
      © 2026 bigteetechhub.All Right Reserved

      Type above and press Enter to search. Press Esc to cancel.