gpt4 book ai didi

ios - 在 nativescript 中的模态中打开模态

转载 作者:行者123 更新时间:2023-12-01 19:34:07 25 4
gpt4 key购买 nike

当我尝试打开一个模态时,我已经在另一个模态中。我收到一条错误消息:

ViewHierarchy: parent is already presenting view controller close the current modal page before showing another one!



这是 playground sample ,我怎样才能在另一种模式中拥有一种模式?

转载
  • 单击按钮(应弹出一个模式)
  • 点击按钮(什么都不会发生,你会得到一个错误)

  • 预期行为

    您应该会看到一个新的弹出窗口打开。

    我的环境
    $ tns info
    ✔ Getting NativeScript components versions information...
    ✔ Component nativescript has 6.5.0 version and is up to date.
    ✔ Component tns-core-modules has 6.5.0 version and is up to date.
    ✔ Component tns-android has 6.5.0 version and is up to date.
    ✔ Component tns-ios has 6.5.0 version and is up to date.

    最佳答案

    nativescript-vue 文档不清楚如何使用嵌套模式,因为它是在 @yukashima-huksay 的帖子之后修复的。但是有an example在 github 上演示了它的使用。
    可以使用 target 打开辅助模式。选项,可以针对当前 View (使用 this )或元素(即 this.$refs[<some element>] )。

    // this
    this.$showModal(SecondaryModal, { target: this });

    // $refs
    this.$showModal(SecondaryModal, { target: this.$refs['myView'] });

    关于ios - 在 nativescript 中的模态中打开模态,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/60767061/

    25 4 0
    Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
    广告合作:1813099741@qq.com 6ren.com