RxWebViewNavigationViewController
作为您的 navigationController!RxWebViewNavigationViewController
作为您的 custom navigationController如下图所示
只需要将“RxWebViewController”文件夹拖入你的项目中即可。
使用非常简单
#import "RxWebViewNavigationViewController.h"
@interface myNavigationViewController : RxWebViewNavigationViewController
@end
然后,将 webviewController 作为普通的 viewController 使用
NSString* urlStr = @"http://github.com";
RxWebViewController* webViewController = [[RxWebViewController alloc] initWithUrl:[NSURL URLWithString:urlStr]];
[self.navigationController pushViewController:webViewController animated:YES];
@interface myWebViewController : RxWebViewController
//do your custom things
@end
导航栏中出现的 “返回” 和 “关闭”,均会继承你的 navigationController 中对 navigationBar 的设置,比如:
UIColor* tintColor = [UIColor whiteColor];
UIColor* barTintColor = [UIColor blueColor];
self.navigationController.navigationBar.tintColor = tintColor;
self.navigationController.navigationBar.barTintColor = barTintColor;
[self.navigationController.navigationBar setTitleTextAttributes:@{ NSForegroundColorAttributeName:tintColor
}];
这样来自定义你的navigationBar各控件颜色,webViewController中会遵循此设置,如图
也可以像微信那样在你的 navigationBar 中使用自定义的 backButtonBackgroundImage,如图
我使用了 NJKWebViewProgress 来做导航进度,它非常有帮助