为什么我的 Apple Watch 复杂功能真机测试显示奇怪的图像?

Why my Apple Watch complication real machine test displays strange images?

提问人:liangmi 提问时间:11/11/2023 最后编辑:liangmi 更新时间:11/12/2023 访问量:30

问:

enter image description here这是我的代码:

struct WidgetView: View {
    var entry: Provider.Entry
    @Environment(\.widgetFamily) var widgetFamily
    var body: some View {
        switch widgetFamily {
            case .accessoryCorner:
            //Text("test")
            Text(entry.configuration.afterClassTime)
                .foregroundColor(.white)
                .frame(maxWidth: .infinity, maxHeight: .infinity, alignment: .center)
                .padding()
                .lineLimit(1)
                .truncationMode(.tail)
                .widgetLabel {
                    Text(entry.configuration.nextclass)
                        .foregroundColor(.white)
                        .frame(maxWidth: .infinity, maxHeight: .infinity, alignment: .center)
                        .padding()
            }
            
            default:
            Text(entry.configuration.afterClassTime)
                .widgetLabel {
                    Text(entry.configuration.nextclass)
                        .font(.system(size: 13))
                }
        }
    }
}

它在模拟器上没有任何问题,并显示我期望的文本

但是一旦我使用我的 Apple Watch se 真实设备进行测试,就会显示这样的图像(左下角)

我搜索了很多文档和一些段落,没有人可以帮助我。谢谢你的帮助。

我试着在 Apple Genius Bar 上提问,但我的需求没有得到回应,Apple 论坛上也没有人回应。

我想测试真实设备是否可以与模拟器显示相同的内容

Swift Xcode SwiftUI 小部件 Apple-Watch-Complication

评论

0赞 Paulw11 11/11/2023
您的问题中没有图像。您应该编辑您的问题以提供最小的可重现示例
0赞 Community 11/12/2023
请澄清您的具体问题或提供其他详细信息以准确说明您的需求。正如目前所写的那样,很难确切地说出你在问什么。

答: 暂无答案