Created
July 4, 2020 15:36
-
-
Save manojkarki/3fef7c309e21e928604ae6694798cba2 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
Xcode 12.0 Beta 1 | |
Scrolling vertically freezes the App | |
*/ | |
struct VGridsExample: View { | |
private var data: [Int] { | |
(0 ... 2500).map {$0} | |
} | |
private var columns: [GridItem] { | |
Array(repeating: GridItem(.fixed(48),spacing: 0), count: 50) | |
} | |
var body: some View { | |
ScrollView([.horizontal, .vertical]) { | |
LazyVGrid(columns: columns, spacing: 0) { | |
ForEach(data, id: \.self) { index in | |
VGridItem() | |
} | |
} | |
} | |
} | |
} | |
struct VGridItem: View { | |
var body: some View { | |
Button { | |
} label: { | |
Text("B") | |
.foregroundColor(Color.green) | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment