ChenYilong / CYLTabBarController

[EN]It is an iOS UI module library for adding animation to iOS tabbar items and icons with Lottie, and adding a bigger center UITabBar Item. [CN]【中国特色 TabBar】一行代码实现 Lottie 动画TabBar,支持中间带+号的TabBar样式,自带红点角标,支持动态刷新。【iOS13 & Dark Mode & iPhone XS MAX supported】
MIT License
6.91k stars 1.45k forks source link

self.title 会改变tabbaritem.title 为什么 #78

Closed lyc59621 closed 7 years ago

ChenYilong commented 8 years ago

iOS系统内部实现就是这么实现的。

lyc59621 commented 8 years ago

那我要怎么写 才不会影响item的title self.navigationItem.title 这样?? 不太好吧

ChenYilong commented 8 years ago

这样写为什么不太好?

lyc59621 commented 8 years ago

有没有方法可以让self.title 方法不影响 tabBarItem.title 这个方法

ChenYilong commented 8 years ago

这是系统实现,暂时没有好的方法。

lizhaojie001 commented 8 years ago

2016-09-01 11 32 11 这样设置还是不能显示navi的title vc

为什么我改变成self.title和不该之前 self.navigationItem.title 都不显示呢

ChenYilong commented 8 years ago

请检查 是否是将该设置放在了 viewDidLoad 方法中,建议放在 viewWillAppear 中, 详情参考 http://stackoverflow.com/a/10982774

ChenYilong commented 8 years ago

这时候ViewController还没有push出来,对应navigation相关属性都是nil,你在这里设置是没用的,请等 ViewController push 出来后设置。

lizhaojie001 commented 8 years ago

vc

ChenYilong commented 8 years ago

为什么不在ViewController push出来后再设置?出于什么考虑?

ChenYilong commented 8 years ago

你po下navigationController属性

lizhaojie001 commented 8 years ago

tabbar的item和这个不一样么,我想和tabbar一起设置,self.title

lizhaojie001 commented 8 years ago

vcc

lizhaojie001 commented 8 years ago

我在navigation下的根控制器设置了title就显示了

ChenYilong commented 8 years ago

具体怎么做的,贴个代码出来吧。

lizhaojie001 commented 8 years ago

1 2 3 4 5 6

lizhaojie001 commented 8 years ago

应该就是在加载过程中,没有加载navi的时候已经加载了根控制器的viewdidload;了