Howdy SwiftUI Developer,
I’m going through very major problem in my undertaking. The situation is one thing like this.
A SwiftUi display has NavigationBar -> Sticky Header -> Horizontal TabBarItems -> TabView
then every TabView
has it is personal View
utilizing ListView
or ScrollView
as required
Drawback is ListView
or ScrollView
isn’t auto rising as per content material even its not seen till not giving the peak to TabView or ContentView
and i can not calculate the content material peak and provides it to the web page as a result of content material ate too dynamic and massive.
Pattern code is as observe –
struct ContentView: View {
var physique: some View {
VStack {
VStack{
Textual content("Sticky Header")
}
ScrollView {
HeaderView()
CustomTabView()
.body(peak: 100) <--- I do not wish to give this peak anymore.
}
}
.padding()
}
}
struct HeaderView: View {
var physique: some View {
Picture("W")
.resizable()
.body(minWidth: 0, maxWidth: .infinity)
.body(peak: 200)
}
}
struct CustomTabView: View {
var physique: some View {
TabView(content material: {
FirstTavView()
FirstTavView()
FirstTavView()
})
.tabViewStyle(.web page(indexDisplayMode: .by no means))
}
}
struct FirstTavView: View {
var physique: some View {
Checklist(0..<100) { index in
Textual content("Index quantity is --- > (index)")
}
}
}