I have a SwiftUI NavigationView with a Button as leading navigation bar item. It seems the button action is fired only when user taps inside that little Image. Can I make the tappable area bigger, without affecting the height of the navigation bar?
I tried adding .frame to the Image, but that made the navigation bar too big.
import SwiftUI
struct ContentView: View {
var body: some View {
NavigationView {
Text("Foo")
.navigationBarTitle(Text("Title"), displayMode: .inline)
.navigationBarItems(leading:
HStack {
Button(action: {
print("tapped")
}) {
Image(systemName: "info.circle")
}
})
}
}
}