You can simply use HStack to separate the name text and its corresponding image.
import SwiftUI
struct ContentView: View {
var body: some View {
TabView{
FirstView()
.tabItem {
HStack {
Text("Save")
.fixedSize()
Image(systemName: "lock.fill")
}
}
SecondView()
.tabItem {
HStack {
Text("Things")
.fixedSize()
Image(systemName: "message.fill")
}
}
}
}
}
struct FirstView: View {
var body: some View {
Text("First")
}
}
struct SecondView: View {
var body: some View {
Text("Second")
}
}
Topic:
UI Frameworks
SubTopic:
SwiftUI
Tags: