Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CollectionView .horizontal axes not working #392

Closed
billp opened this issue Sep 28, 2022 · 1 comment
Closed

CollectionView .horizontal axes not working #392

billp opened this issue Sep 28, 2022 · 1 comment
Assignees

Comments

@billp
Copy link

billp commented Sep 28, 2022

I want to create a carousel like view with horizontal scrolling using a CollectionView but it seems that the axes parameter on initializer is ignored. Any ideas?

import SwiftUI
import SwiftUIX

struct Model: Identifiable {
    var id: UUID = UUID()
    var name: String
}

struct ContentView: View {
    @State var animated: Bool = false
    @State var text: String = "test"
    
    var sections = (1...5).map { Model(name: String($0)) }
    var data = (1...99).map { Model(name: String($0)) }

    var body: some View {
        CollectionView(.horizontal, sections, id: \.id) { section in
            Section { 
                ForEach(data) { item in
                    Text(item.name)
                }
            }
        }
    }
}

Screenshot 2022-09-28 at 5 02 19 PM

@vmanot vmanot self-assigned this Feb 18, 2023
@vmanot
Copy link
Member

vmanot commented Sep 1, 2023

This is now fixed.

@vmanot vmanot closed this as completed Sep 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants