To run the example project, clone the repo, and run pod install
from the Example directory first.
TYNavBarStyle is available through CocoaPods. To install it, simply add the following line to your Podfile:
pod 'TYNavBarStyle'
- 修改导航栏自定义按钮位置
- 自定义返回按钮
+ (void)configNavBarStyle {
TYNavBarTintEngine *tintEngine = [TYNavBarTintEngine createSharedEngine];
tintEngine.debugModel = YES;
tintEngine.navBarItemHorizontalMargin = DTNavBarMargin;
[tintEngine setBackItemConfig:^(UIButton *backButton) {
UIImage *backImage = [UIImage ty_imageWithIcon:DTIconfontNavBack
fontSize:24.f
tintColor:[UIColor blackColor]];
[backButton setImage:backImage forState:UIControlStateNormal];
return YES;
}];
// 过滤系统页面
tintEngine.ignoreConfigNavBarVcClass = @[@"ABNewPersonViewController",
@"CNContactViewHostViewController",
@"CNContactViewController",];
TYNavBarStyleConfig *defaultConfig = [TYNavBarStyleConfig navBarStyleConfigWithTitleColor:[UIColor defaultNavBarTitleColor]
titleFont:nil
tintColor:[UIColor defaultNavBarTextColor]
itemFont:nil
barTintColor:[UIColor defaultNavBarBackgroundColor]
statusBarStyle:UIStatusBarStyleDefault];
tintEngine.navBarStyleConfigs = @{TYNavBarStyleDefault: defaultConfig};
}
[email protected], [email protected]
TYNavBarStyle is available under the MIT license. See the LICENSE file for more info.