1

I have a "problem" with my iOS 17 app. My view don't correctly appear like it was before iOS 17 and now only shows the SFSymbol but not the Text.

NavigationView {
     ZStack(alignment: .bottomTrailing) {
          //my body
     }
     .toolbar {
          ToolbarItem(placement: .navigationBarTrailing) {
               NavigationLink(destination: StreakView(dayStreak: viewModel.dayStreak)) {
                    HStack {
                         Text("\(viewModel.dayStreak)")
                         Image(systemName: "flame.fill")
                    }
               }
           }
      }
}

The Text is not shown on the screen... Why?

I don't know what to do to fix this problem...

Thank you for your responses <3

Clément
  • 31
  • 3
  • The code should work, I have tested it and it works just fine, [take a look](https://imgur.com/a/vnM7AuX). You probably have an issue with the ViewModel and the dayStreak variable, can you edit your post and upload the ViewModel code? – Javier Galera Jul 27 '23 at 14:12

1 Answers1

0

Currently, there may be a potential bug or a deliberate change from Apple. To enable the use of your label as you desire, you must modify the ToobarPlacement to either .principal or .status. Additionally, it is important to note that the .navigationBarLeading and .navigationBarTrailing properties have been deprecated. Instead, you should use .topBarLeading and .topBarTrailing as replacements for the deprecated ones.