draveness / DKNightVersion

Manage Colors, Integrate Night/Multiple Themes. (Unmaintained)
MIT License
3.55k stars 516 forks source link

When set self.navigationItem.tilte 's color .your way can't change the title color. #78

Closed 13098806890 closed 7 years ago

13098806890 commented 7 years ago

The only way to set self.navgitaionItem.title's color is to set TitleTextAttributes instead of the color. for example. NSDictionary *dic = [NSDictionary dictionaryWithObjectsAndKeys: [UIColor blackColor],NSForegroundColorAttributeName, nil]; [self.navigationController.navigationBar setTitleTextAttributes:dic]; self.navigationItem.title = @"theTitleIWantToChangeColor";

but the way you offer can;t solve this.

So, I overwrite the method - (void)night_updateColor in UINavigationBar+Night.m and add a property to support that, but this is just a temp way to solve this. Hope you offer a better way to solve this.

gbfansheng commented 7 years ago

same question

draveness commented 7 years ago

这种方法确实可能会有问题,不过你可以在一个 block 中配置颜色,DKNightVersion 会在每次改变主题时,调用 block

13098806890 commented 7 years ago

我是重写了updatecolor方法,可以丢子典型数据进去 发自网易邮箱大师 在2017年03月12日 21:10,Draveness 写道:

这种方法确实可能会有问题,不过你可以在一个 block 中配置颜色,DKNightVersion 会在每次改变主题时,调用 block

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or mute the thread.

ieliwb commented 5 years ago

楼主解决了吗? 怎么不重写titleVIew改变nav title颜色呀