RTRootNavigationController icon indicating copy to clipboard operation
RTRootNavigationController copied to clipboard

导航栏隐藏导致vc内部的tableview有位移

Open AmadeusSys opened this issue 6 years ago • 12 comments
trafficstars

入口 image 其中 MineViewController 是隐藏导航栏的 使用的是 self.navigationController?.isNavigationBarHidden = true 应用初始化后在HomeViewController 页面 没有问题,但是切换至MineViewController 在切换回来的时候回让 HomeViewController的内容下移20个高度,大概一个状态栏的高度,

AmadeusSys avatar Dec 03 '18 08:12 AmadeusSys

MainTabBarController 继承自哪里?

rickytan avatar Dec 03 '18 11:12 rickytan

不是原生TabBarController https://github.com/ChenYilong/CYLTabBarController

AmadeusSys avatar Dec 04 '18 04:12 AmadeusSys

可能跟这个:https://github.com/rickytan/RTRootNavigationController/issues/11 一样,请使用 0.6.x 版本,0.7 已经放弃

rickytan avatar Dec 04 '18 05:12 rickytan

试了一下0.6.7和0.6.6都不行

AmadeusSys avatar Dec 04 '18 06:12 AmadeusSys

麻烦放个能运行的 demo 程序

rickytan avatar Dec 07 '18 01:12 rickytan

https://github.com/AmadeusSys/NavigationDemo demo上传到这里 还需要设置isTranslucent会触发 self.navigationController?.navigationBar.isTranslucent = false

AmadeusSys avatar Dec 07 '18 10:12 AmadeusSys

@AmadeusSys 你好~请问一下你这个问题解决了吗?貌似我这边也遇到一样的问题,而且我项目里也是用得CYLTabBarController

seanLee avatar Sep 02 '19 05:09 seanLee

我这边用系统的TabbarController,发现也会有同样的情况.应该跟CYLTabBarController没关系. 又尝试了一下,应该跟TabbarController没有影响.在您提供的Demo里有一个ScollView的界面,把其中的CollectionView的方向换成Vertical,就能重现这个问题.导航栏不透明的话,就会出现这个问题.

seanLee avatar Sep 02 '19 06:09 seanLee

我最终使用的不透明导航栏

AmadeusSys avatar Sep 04 '19 01:09 AmadeusSys

能麻烦提供一下代码吗?还是不太懂你这边的处理方式.

seanLee avatar Sep 04 '19 03:09 seanLee

应该是 self.navigationController.navigationBar.translucent = NO

rickytan avatar Sep 04 '19 11:09 rickytan

@AmadeusSys 你好~我想问一下,我这边用了一个纯色的图片作为导航栏的填充,所以之后的导航栏本身就是非透明的.就是因为这样,到底每次pop回来tableview或者说scrollview都会自动偏移.你那边就是设置了导航栏非透明然后就没有这个问题啦吗?

seanLee avatar Sep 11 '19 10:09 seanLee