【问题标题】:When I click in the TabBar item , The Entire TabBar disappears.... , Swift , Xcode [closed]当我单击 TabBar 项目时,整个 TabBar 消失....,Swift,Xcode [关闭]
【发布时间】:2020-11-12 20:28:55
【问题描述】:

我不知道为什么会这样,但如果你这样做了,请告诉我。 当我单击 TabBar_ProfileButton 时,转到 Profilepage ,然后再次单击 TabBarButton_ChatButton,然后转到 ConversationView,TabBar 消失。我不知道为什么...... 我试图调用 tabBat isHidden = false 以不消失,并且因为第一个导航控制器 TabBar 是隐藏的,因为它不必出现在 welcomeView 、 loginView 或 registerView 中。

Storyboard,Storyboard - WelcomeVC - Descriptions,Storyboard - ConversationVC - Description,ConversationVC Swiftfile - Code,First time ConversationVC Loads,First time ProfileVC Loads,Second time ConversationVC Loads - TabBar Disappears,

【问题讨论】:

    标签: ios swift xcode swift5 xcode12


    【解决方案1】:

    您必须为您的 tableView 设置约束或更改它的 contentInset。否则你的 tableView 会出现在 TabBar 的顶部,这就是它消失的原因

    尝试使用此代码:
    tableView.contentInset.bottom = self.tabBarController?.tabBar.frame.height ?? 0

    下次请务必放上你的代码,不要只是截屏,因为别人读起来不舒服!

    【讨论】:

    • 谢谢!下次我会确保放代码,对不起,这是我的第一篇文章;)
    猜你喜欢
    • 2020-08-20
    • 1970-01-01
    • 2019-08-03
    • 2019-11-09
    • 2018-05-27
    • 2016-08-22
    • 1970-01-01
    • 2018-05-10
    • 1970-01-01
    相关资源
    最近更新 更多