The following SwiftUI code will generate Bottom Tab
public struct TeamBContentView : View {
public init() {}
public var body: some View {
VStack {
TabView {
Text("This is home screen")
.tabItem {
Text("Home")
Image(systemName: "house.fill")
}
Text("This is about us screen")
.tabItem {
Text("About Us")
Image(systemName: "person.fill")
}
Text("This is contct us screen")
.tabItem {
Text("Contact Us")
Image(systemName: "phone.fill")
}
}
}
}
}
As below
If I want to have it at the Top, is there a way easily transfer it to the Tab to the top of the screen instead?
2
Answers
One simple way is to use the library provided by https://github.com/QuynhNguyen/SlidingTabView
As of how to add the Package of the library, refers to the last section of this article
Then you can use the below code,