SwiftUI出现displayModeButtonItem is internally managed and not exposed for DoubleColumn style错误的解决
Posted 大熊猫侯佩
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了SwiftUI出现displayModeButtonItem is internally managed and not exposed for DoubleColumn style错误的解决相关的知识,希望对你有一定的参考价值。
Xcode12.x开发环境中,用户在点击SwiftUI列表项进行导航跳转后,当回退到父视图时,Xcode控制台会有提示:
[Assert] displayModeButtonItem is internally managed and not exposed for DoubleColumn style. Returning an empty, disconnected UIBarButtonItem to fulfill the non-null contract.
该列表往往包含在一个复杂的层级结构中。
解决办法是,在最外层的NavigationView上添加如下修改器:
NavigationView
...
.
以上是关于SwiftUI出现displayModeButtonItem is internally managed and not exposed for DoubleColumn style错误的解决的主要内容,如果未能解决你的问题,请参考以下文章