Reputation: 417
I have a TabBar view which has a navigation view as one of the tabs. On iPad the view hugs the left and I want a picture/logo on the right hand side next to it (as shown in the picture). How would I add this in?
Here is my navigation view code:
struct StartGameScreen: View {
@ObservedObject var processor = EventsProcessor.shared
@State var showGame = false
var body: some View {
NavigationView{
Form{
Section(header: Text("Teams")){
TextField("Home Team Name", text: $homeName)
TextField("Away Team Name", text: $awayName)
}
Section(header: Text("The Fixture")){
TextField("Location", text: $location)
DatePicker("Date of Fixture", selection: $date, displayedComponents: .date)
}
Section(header: Text("Officials")){
TextField("Referee", text: $referee)
TextField("Assistant Referee 1", text: $ar1)
TextField("Assistant Referee 1", text: $ar2)
TextField("4th Official", text: $fourthOfficial)
TextField("Televsion Match Official", text: $tmo)
}
Button("Start Game"){
self.showGame.toggle()
}
.fullScreenCover(isPresented: $showGame, content: {
ContentView()
})
}
.navigationBarTitle("New Game")
}
}
}
Upvotes: 1
Views: 50
Reputation: 257693
You can add it
var body: some View {
NavigationView{
Form{
// ... other code
}
.navigationBarTitle("New Game")
Image("logo") // << here !!
}
}
Upvotes: 2