gpt4 book ai didi

ios - 未从选项卡栏 Controller 调用 viewdidappear

转载 作者:行者123 更新时间:2023-11-28 07:43:14 24 4
gpt4 key购买 nike

我有一个 TabBarControllerNavigationController...主要的 TabController 有一些我想添加边框的按钮...我在 ViewDidAppear 中执行此操作但未调用!当我转到子 Controller 并单击后退按钮时,它现在被调用..但是当第一次单击该选项卡时,它不会被调用!

我正在做的是在主选项卡 vc 中:

  override func viewDidAppear(_ animated: Bool) {
super.viewDidAppear(animated)

if MOLHLanguage.isArabic(){
aboutusbtn.addRightBorderHome( borderWidth: 3)
rulesbtn.addRightBorderAboutus(borderWidth: 3)
committeebtn.addRightBorderHistory(borderWidth: 3)
generalbtn.addRightBorderShare(borderWidth: 3)
publickbtn.addRightBorderHome(borderWidth: 3)
contactusbtn.addRightBorderAboutus(borderWidth: 3)
}else{
aboutusbtn.addLeftBorderHome(width: 3)
committeebtn.addLeftBorderAboutus(width: 3)
rulesbtn.addLeftBorderHistory(width: 3)
generalbtn.addLeftBorderShare(width: 3)
publickbtn.addLeftBorderHome(width: 3)
contactusbtn.addLeftBorderAboutus(width: 3)
}
}

但是直到我从 child 那里点击返回时才会调用它......但是当第一次点击选项卡时它不会被调用!

为什么?以及如何解决这个问题?

最佳答案

我找到了解决方案..

我刚刚添加了以下内容:

override func viewDidAppear(_ animated: Bool) {
super.viewDidAppear(animated)
}

在导航 Controller 中,就解决了! :)

关于ios - 未从选项卡栏 Controller 调用 viewdidappear,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51648081/

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