Thursday, October 29, 2026
HomeiOS Developmentios - SwiftUI NavigationView title principal merchandise partially obscured after return from...

ios – SwiftUI NavigationView title principal merchandise partially obscured after return from subView

[ad_1]

I am attempting to make use of a VStack with two Textual content objects for a centred title. It seems to be one thing like this:

enter image description here

Once I go to a subView after which return, it seems to be the identical for a second however then an obscuring bar seems throughout the highest of the higher Textual content merchandise like this:

enter image description here

This code demonstrates the issue.

import SwiftUI

struct ContentView: View {
    var physique: some View {
        NavigationView {
            NavigationLink("Go to Second View", vacation spot: SecondView())
                .toolbar {
                    ToolbarItem(placement: .principal) {
                        VStack {
                            Textual content("Title Title Title").font(.title).daring()
                            Textual content("Subtitle").font(.subheadline).padding(.backside)
                        }
                    }
                }
        }.navigationBarTitleDisplayMode(.inline)
    }
}

struct SecondView: View {
    var physique: some View {
        Textual content("Second View")
    }
}

I’ve tried shifting the .displayMode round and tried the totally different modes however I need to hold the NavigationView because the extra compact .inline model. In need of an answer I will need to rethink, thanks.

[ad_2]

RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Most Popular

Recent Comments