Created
February 9, 2022 07:54
-
-
Save AvdLee/e675d5c7fd6a014a806b170766f190a6 to your computer and use it in GitHub Desktop.
Horizontal Scroll in StockAdvisor
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
ScrollView(.horizontal, showsIndicators: false) { | |
HStack(spacing: 0) { | |
ForEach(viewModel.criteria(for: category), id: \.valueProvider.title) { criteria in | |
StockCriteriaView(criteria: criteria) | |
.frame(width: UIScreen.main.bounds.width - 60) | |
.padding(.trailing, 12) | |
} | |
} | |
}.frame(width: UIScreen.main.bounds.width - 48) | |
.padding(.horizontal, 14) | |
.introspectScrollView { scrollView in | |
scrollView.isPagingEnabled = true | |
scrollView.clipsToBounds = false | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment