gpt4 book ai didi

ios - 当 isTranslucent = False 时导航栏展开(Swift 3)

转载 作者:塔克拉玛干 更新时间:2023-11-02 22:10:12 26 4
gpt4 key购买 nike

我有一个带有搜索栏的表格 View 。但是,当我单击搜索栏时,导航栏似乎会展开并在其下方创建一个空白区域。但是,这只发生在 self.navigationController?.navigationBar.isTranslucent = false 但当我评论这一行时,空白永远不会出现。此外,仅当我按下搜索栏时才会出现白色栏。以下是一些图片供引用:

  1. 这是我不按搜索栏的时候。
  2. 然后,当我按下搜索栏时,它下方会出现一个空白区域。
  3. 然后当我取消搜索栏时,空白区域位于导航栏和搜索栏之间。

This is when I don't press the search bar.

Then when I press the search bar a white space appears under it.

And then when I cancel out of the search bar the white space is between the navigation bar and the search bar.

最佳答案

viewDidLoad中添加这一行:

 self.automaticallyAdjustsScrollViewInsets = false

关于ios - 当 isTranslucent = False 时导航栏展开(Swift 3),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44373419/

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