1.
UIViewController 默認方式 XIB viewDidLoad
UIViewController.view addSubView ---------範圍 中間部分
UINavigationController 導航視圖控制器 棧關係
initWithRootViewController -----------範圍 除去最下面部分 包含狀態欄
UITabBarController 標籤視圖控制器 平級關係 tabBar高度49
NSArray *array=@[navVC];
tabVC.viewControllers=array; -----------範圍 整個屏幕
在UITabBarItem 中寫方法 self.tabBarItem.image
都可以控制視圖控制器UIViewController 而他兩也都屬於視圖
2.UITabBarItem 可以自己直接調用屬性賦值
也可以創建一個 UITabBarItem 然後賦給自己
homeViewController.tabBarItem=tabItem
3.用戶可以自己定製UITabBarItem
自定義UITabBarController裏創建一個視圖 添加按鈕 記住不是UITableViewController
4.window 添加視圖
window.rootViewController 添加根視圖控制器
5.一定要記住圖片 數組 取的是字符串 不報錯 只崩潰
6.UINavigationControllerDelegate UINavigationController的代理
UITabBarController 實現其協議,別的導航控制器調用代理
if (navigationController.viewControllers.count==1)
7.自定義UITabBarItem 視圖切換動畫效果
if (navigationController.viewControllers.count==1) {
[UIView beginAnimations:Nil context:Nil];
[UIView setAnimationDuration:.25];
_tabBarView.frame=CGRectMake(0, screenHeight-49, screenWidth,49);
[UIView commitAnimations];
}
按鈕點擊 視圖切換效果
UIImageView *imageView=(UIImageView *)[_tabBarView viewWithTag:101];
[UIView beginAnimations:Nil context:nil];
[UIView setAnimationDuration:0.25];
imageView.center=button.center;
[UIView commitAnimations];
8.切換導航欄
if(button.tag==0)
self.selectedIndex=0;
else if(button.tag==4)
self.selectedIndex=1;
9.[UIScreen mainScreen].bounds.size.height 屏幕的高度
Tab控制器
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章
【ios 彙總 你可能不知道的調試技巧】
听着rap写代码
2020-02-20 22:14:16
textFiled要注意的地方
moon_shine
2020-06-24 18:40:42
AWS S3服務
阿飞小伙子_blogs
2020-06-04 13:28:05
UIScrollView頻道滑動(授人以魚,不如授人以漁)
hherima
2020-02-21 23:59:46
SDWebImage源碼解析
阿飞小伙子_blogs
2019-06-22 01:56:17
【精】iOS知識樹,知識點(包括對象、Block、消息轉發、GCD、運行時、runloop、動畫、Push、KVO、tableview,UIViewController、提交AppStore)
hherima
2018-09-04 22:03:01
IOS 開發,調用打電話,發短信,打開網址
moon_shine
2018-08-31 21:25:18
iOS系統架構和常用框架
陈荣科
2018-08-31 01:08:49
ios 內購服務器驗票(漏單處理)
听着rap写代码
2018-08-28 22:52:36
UIScrollView的基本用法
逝华_浮梦
2018-08-28 06:52:14