QuintGao / GKNavigationBarViewController

iOS自定义导航栏-导航栏联动
https://www.jianshu.com/p/577755d0d69a
MIT License
727 stars 130 forks source link

设置gk_navItemLeftSpace、gk_navItemRightSpace会复原 #41

Closed sevenmylove520 closed 4 years ago

sevenmylove520 commented 4 years ago

tabbarController的viewControllers在自定义BarButtonItem时设置了space

sevenmylove520 commented 4 years ago

tabBar切换,BarButtonItem的space会复原为0

QuintGao commented 4 years ago

最新版已修复

sevenmylove520 commented 4 years ago

更新最新版本还是这个状况哦

sevenmylove520 commented 4 years ago

我在viewDidLoad内创建我的自定义barButtonItem,测试了下,还是会切换时,space变为0

sevenmylove520 commented 4 years ago

两个页面的自定义barButtonItem的gk_navItemLeftSpace、gk_navItemRightSpace是相等的, if (configure.gk_navItemLeftSpace == self.gk_navItemLeftSpace) { configure.gk_navItemLeftSpace = configure.navItemLeftSpace; }

if (configure.gk_navItemRightSpace == self.gk_navItemRightSpace) { configure.gk_navItemRightSpace = configure.navItemRightSpace; }

你这么判断,是会相等的,也会进入判断中,去赋值

QuintGao commented 4 years ago

image 你把viewWIllAppear里面这样改下,然后把viewWillDisappear里面的代码去掉,看看有没有问题

sevenmylove520 commented 4 years ago

尝试了下,把你GKNavigationBarViewController viewWillDisappear中的代码注释了,并且修改了你图中所说需要修改的地方,还是一样的结果

QuintGao commented 4 years ago

我这试的没问题啊,你怎么用的,能提供demo?

sevenmylove520 commented 4 years ago
sevenmylove520 commented 4 years ago

问题解决了,如果是用pod管理这个库,建议clean后再编辑

FLY88913 commented 3 years ago

gk_navItemRightSpace 设置也不对-1