gpt4 book ai didi

swift - iOS swift : Install and Unistall views programmatically

转载 作者:搜寻专家 更新时间:2023-10-31 22:05:42 26 4
gpt4 key购买 nike

如何以编程方式安装和卸载 View ?

例子

在我的应用程序中,我有一个 StackView,其中包含三个不同的View:Character、Starship 和 Vehicle。

enter image description here

现在,我希望在某种情况下,只有一个 View 会出现,而另外两个不会出现。

我不是说隐藏和显示,而是安装和卸载。为什么?因为如果我继续安装我的 View ,我的 Xcode 会崩溃。

enter image description here

有什么建议吗?

最佳答案

我相信您正在寻找的答案就在这里 - https://stackoverflow.com/a/36712325/2463875

If You install or uninstall view from storyboard, It is equivalent to add/remove view.

关于swift - iOS swift : Install and Unistall views programmatically,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40240654/

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