在moreNavigationController上的自定义NavigationBar [英] Custom navigationBar on moreNavigationController

查看:70
本文介绍了在moreNavigationController上的自定义NavigationBar的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否要自定义导航栏,该导航栏出现在UITabBarController的更多"选项卡上,以2像素(不同颜色)的线作为底边框?

Hot to customize navigation bar that appear on "More" tab in UITabBarController to have 2 px line (in different color) as bottom border?

我创建了UINavigationBar的子类,该子类使用该行的绘制覆盖了drawrect:方法,并且适用于前四个选项卡,但更多导航控制器下的选项卡除外.

I created subclass of the UINavigationBar that overrides drawrect: method with drawing of that line, and that works for first four tabs, except tabs that are under more navigation controller.

有帮助吗?

推荐答案

#import <objc/runtime.h>

并动态设置more view controller导航栏的类:

And dynamically set the class of the more view controller's navigation bar:

object_setClass(yourTabBarController.moreNavigationController.navigationBar, 
                [YourNavigationBarSubClass class]);

这篇关于在moreNavigationController上的自定义NavigationBar的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆