为什么 .imageScale(.large) 不像 iOS 股票应用程序那样大?
Why is .imageScale(.large) not big like in iOS stock apps?
我将 NavigationView 与一些 navigationBarItem 一起使用。
我已经指定两个按钮的尺寸(或比例)必须是 .large(就像在 Apple 的 SwiftUI 教程中一样)但是正如您在下面看到的那样,它们不如 iOS 库存应用程序中的 navigationBarItems 大在快捷方式或电子钱包中。
感谢任何帮助!
谢谢!
图片:
Apple 的快捷方式应用程序
我的观点
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")
}
}
}
而不是 .imageScale(.large)
使用 .font(.largeTitle)
我将 NavigationView 与一些 navigationBarItem 一起使用。 我已经指定两个按钮的尺寸(或比例)必须是 .large(就像在 Apple 的 SwiftUI 教程中一样)但是正如您在下面看到的那样,它们不如 iOS 库存应用程序中的 navigationBarItems 大在快捷方式或电子钱包中。
感谢任何帮助! 谢谢!
图片:
Apple 的快捷方式应用程序
我的观点
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")
}
}
}
而不是 .imageScale(.large)
使用 .font(.largeTitle)