Describe the bug
So I am currently trying to have a CardView container. It seems to work in the preview and pretty much everywhere independently, but as soon as I use it with ASCollectionView, it seems to break and do not show the labels.
To Reproduce
TradeView
struct TradeView: View {
@ObservedObject var viewModel: TradeViewModel
var body: some View {
NavigationView {
ASCollectionView(data: viewModel.tradeCellViewModels, dataID: \.self) { tradeCellViewModel, _ in
TradeCellView(viewModel: tradeCellViewModel)
}
.layout {
.grid(layoutMode: .adaptive(withMinItemSize: 300),
itemSpacing: 8,
lineSpacing: 8,
itemSize: .estimated(600))
}
.navigationBarTitle("Trade")
}
.navigationViewStyle(StackNavigationViewStyle())
}
}
#if DEBUG
struct TradeView_Previews: PreviewProvider {
static var previews: some View {
Group {
TradeView(viewModel: TradeViewModel(with: Provider()))
}
}
}
#endif
It is likely you need to add a fixedSize modifier to the Text items. Otherwise SwiftUI will allow them to be collapsed when it determines the smallest fitting size 👍
Hey guys!
Describe the bug So I am currently trying to have a
CardView
container. It seems to work in the preview and pretty much everywhere independently, but as soon as I use it withASCollectionView
, it seems to break and do not show the labels.To Reproduce
TradeView
TradeCellView
Container
Current Behaviour
Expected behaviour
Xcode Version:
Simulator, Device, Both?
Thank you for any future help 👍