Navigation destination Optional<TeamView> 每帧多次更新错误排查求助
我正在开发一个从API拉取数据的赛事预测功能,结果碰到了这么个错误:Navigation destination Optional<TeamView> tried to update multiple times per frame。
我试过把MatchPredictionsView嵌套进NavigationLink里,但这和PlayerCards的UI设计完全不搭。我现在有点懵——填充球员卡片和教练的数据明明已经加载完成了,而且视图显示出来之后我也没再去更新它,怎么还会出这个问题呢?如果有人能给我一些建议,告诉我以后怎么避免这类问题,真的非常感谢!
以下是我的代码片段:
struct TeamView: View { let team: Team @State private var teamImage: UIImage? = nil @State var displayPredictions: Bool = false @State var processing: Bool = false var body: some View { NavigationView { if processing { ProgressView() } else { ZStack { VStack { // Header Content... // 原代码此处内容未完整提供 } } } } } }
备注:内容来源于stack exchange,提问作者JonGrimes20
相关产品推荐
相关产品推荐

