Ios 是否可以将NavigationButton更改为显示图像而不是蓝色?
我试图设置一个Ios 是否可以将NavigationButton更改为显示图像而不是蓝色?,ios,swift,swiftui,Ios,Swift,Swiftui,我试图设置一个导航按钮来显示图像,而不仅仅是一个蓝色按钮 目前,我正在显示一个由图像组成的水平滚动视图 这些图像将导致另一个视图,该视图将在根视图上方呈现 但是,当我将这些图像环绕在导航按钮上时,这些图像显示为蓝色,而不是原来的图像 CategoryRow组件(ScrollView) ContentView(其中呈现CategoryRow) 我希望这些图像可以像按钮一样工作(它确实这样做了),但仍然显示原始图像,而不是全部为蓝色 预期结果和实际结果的图像如下所示: 尝试更改渲染模式 Image
导航按钮
来显示图像,而不仅仅是一个蓝色按钮
目前,我正在显示一个由图像组成的水平滚动视图
这些图像将导致另一个视图,该视图将在根视图
上方呈现
但是,当我将这些图像环绕在导航按钮
上时,这些图像显示为蓝色,而不是原来的图像
CategoryRow组件(ScrollView
)
ContentView(其中呈现CategoryRow)
我希望这些图像可以像按钮一样工作(它确实这样做了),但仍然显示原始图像,而不是全部为蓝色
预期结果和实际结果的图像如下所示:
尝试更改渲染模式
Image(place.imageName)
.renderingMode(.original)
var body: some View {
NavigationView {
List {
FeaturedCard(places: fiveRandomPlaces)
CategoryRow(label: "Australia")
CategoryRow(label: "Japan")
CategoryRow(label: "Singapore")
CategoryRow(label: "Indonesia")
ForEach(store.places) { place in
PlaceCell(place: place)
}
}
.navigationBarTitle(Text("Been There"))
.navigationBarItems(trailing: Button(action: sortPlaces) {
Text("Sort")
})
.listStyle(.grouped)
}
}
Image(place.imageName)
.renderingMode(.original)