CLAdvanceNavigationControlleriOS 導(dǎo)航欄
CLAdvanceNavigationController 是頁(yè)面切換時(shí),擁有前進(jìn)效果的導(dǎo)航欄。
使用方法:
在 AppDelegate.h 中聲明全局導(dǎo)航欄
@class CLAdvanceNavigationController;
/** 全局導(dǎo)航欄 */
@property (strong, nonatomic) CLAdvanceNavigationController *navController;
在 AppDelegate.m 中初始化全局導(dǎo)航欄
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
// 創(chuàng)建屏幕窗口視圖
self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
self.window.backgroundColor = [UIColor whiteColor];
// 創(chuàng)建并設(shè)置全局導(dǎo)航欄為window的根視圖
self.navController = [[CLAdvanceNavigationController alloc] init];
self.window.rootViewController = self.navController;
// 設(shè)置導(dǎo)航欄首頁(yè)
FirstViewController *firstVC = [[FirstViewController alloc] init];
[self.navController pushViewController:firstVC animated:YES];
return YES;
}
在做頁(yè)面切換時(shí),使用正常使用導(dǎo)航欄代碼
ThridViewController *thridVC = [[ThridViewController alloc] init];
[self.navigationController pushViewController:thridVC animated:YES];
[self.navigationController popViewControllerAnimated:YES];
[self.navigationController popToRootViewControllerAnimated:YES];評(píng)論
圖片
表情
