Q-Mobile / QGrid

🎛 QGrid: The missing SwiftUI collection view.
MIT License
1.64k stars 104 forks source link

Use QGrid inside another scroll view #48

Closed ForceGT closed 3 years ago

ForceGT commented 3 years ago

I have a use case where I need to have a parent scroll view with some other content and then I have a QGrid view that scrolls by itself How do I handle this case as the scrolling is not intuitive I would like to know if I could do something to resolve this

VStack{
                    ScrollView(.vertical , showsIndicators: false){
//                        VStack(alignment: .leading, spacing: 10) {
                            BannerView()
                            CategoryRow().environmentObject(self.latestViewModel)
                            ColorRow().environmentObject(self.latestViewModel)
                    }
                            if(latestViewModel.error.isEmpty){
                               QGrid(latestViewModel.wallpapers,columns: self.columns, vSpacing : 20.0, hSpacing: 5.0,
                                       hPadding: 10.0, endReached: {
                                        //print("End Reached")
                                        self.latestViewModel.getMoreWallpapers()
                                       }){wallpaper in
                                    self.getLatestTabItem(wallpaper: wallpaper)
                                }

Just a code snippet to demonstrate what I exactly want to do

ForceGT commented 3 years ago

Solved works as intended