且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

PresentationButton 在视图中隐藏图像

更新时间:2023-11-29 16:09:28

您可能希望将 rederingMode 添加到图像中,如下所示:

You may want to add rederingMode to the image as follows :

PresentationButton(destination: CardStack()) {
    Image("breast_image")
        .renderingMode(.original)
        .padding()
}

顺便说一句,这不是错误,Button 视图尝试使用提供的图像作为模板(以呈现按钮状态),并且它需要知道您的图像应该被呈现为实际图像相反.

Btw, it's not a bug, the Button view tries to use the supplied image as a template (to render button states) and it needs to know that your image should be rendered as an actual image instead.