In the documentation for TabbedView
it says you can add both a Text and an Image View by using a LayoutView. I'm unable to find any reference to LayoutView anywhere.
This works:
.tabItemLabel(Image("image"))
And this works:
.tabItemLabel(Text("image"))
How can I show both like UITabBarItem does?
In Xcode Beta 3, this has been fixed. Here is an example.
.tabItem {
Image(systemName: "circle")
Text("Hello")
}
Use the following code to set image and text both in TabbedView
,
See this post for more info https://forums.developer.apple.com/thread/117472
TabbedView {
tabOne()
.tabItemLabel {
Image(systemName: "image1")
Text("Tab 1")
}
tabTwo()
.tabItemLabel {
Image(systemName: "image2")
Text("Tab 2")
}
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With