Search code examples
iosuinavigationcontrollerswiftui

Why is .imageScale(.large) not big like in iOS stock apps?


I am using the NavigationView with some navigationBarItems. I have specified that the dimension (or scale) of both buttons has to be .large (like in the SwiftUI tutorials by Apple) but as you can see below they are not as big as the navigationBarItems in iOS stock apps like in Shortcuts or Wallet.

Any help is appreciated! Thanks!

Images:

Shortcuts App by Apple

enter image description here

My View

enter image description here

struct GroupsTab: View {

  var addButton: some View {
      Button(action: {}) {
        Image(systemName: "plus.circle.fill")
          .imageScale(.large)

          // TO ACHIEVE THE SAME RESULT AS IN IOS I NEED TO SCALE THE IMAGE BY ABOUT 1.2 BUT IT BECOMES BLURRY
          //.scaleEffect(1.2)
      }
  }

  var editButton: some View {
    Button(action: {}) {
      Text("Edit")
        .imageScale(.large)
    }
  }

  var body: some View {
    NavigationView {

      Text("hello world")

      .navigationBarItems(leading: editButton, trailing: addButton)
      .navigationBarTitle("Groups")
    }
  }
}

Solution

  • Instead of .imageScale(.large) use .font(.largeTitle)