国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 學院 > 開發設計 > 正文

UITabBarController初學

2019-11-14 20:29:54
字體:
來源:轉載
供稿:網友

純代碼編寫UITabBarController, 不多說,直接見代碼

RViewController1 *vc1 = [[RViewController1 alloc]init];        UINavigationController *navController = [[UINavigationController alloc]initWithRootViewController:vc1];    //只賦值 tabBarItem.title, 通過.title屬性取值是取不到值    //navController.tabBarItem.title = @"Page 1";        //相當于對tabBarItem.title  和 navigationItem.title同時賦值    navController.title = @"Page 1";    navController.tabBarItem.image = [UIImage imageNamed:@"1.jpg"];        RViewController2 *vc2 = [[RViewController2 alloc]init];    vc2.title =@"Page 2";//    UITabBarItem *item2 = [[UITabBarItem alloc]initWithTitle:@"Page 2" image:[UIImage imageNamed:@"2.png" ] selectedImage:[UIImage imageNamed:@"2_    vc2.tabBarItem.image = [UIImage imageNamed:@"2.png"];        RViewController3 *vc3 = [[RViewController3 alloc]init];    vc3.title =@"Page 3";    vc3.tabBarItem.image = [UIImage imageNamed:@"3.png"];        RViewController4 *vc4 = [[RViewController4 alloc]init];    vc4.title =@"Page 4";    vc4.tabBarItem.image = [UIImage imageNamed:@"4.png"];    vc4.tabBarItem.badgeValue = @"10";        RViewController5 *vc5 = [[RViewController5 alloc]init];        //創建 UITabItem的實例    UITabBarItem *item1 = [[UITabBarItem alloc]initWithTabBarSystemItem:UITabBarSystemItemHistory tag:0];    vc5.tabBarItem = item1;        NSArray *controllers = [NSArray arrayWithObjects:navController,vc2,vc3,vc4, nil];        UITabBarController *tabController = [[UITabBarController alloc]init];    tabController.viewControllers = controllers;        self.window.rootViewController = tabController;

 


發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 湘潭县| 枣强县| 东山县| 望江县| 昌都县| 九寨沟县| 梁平县| 宝兴县| 嘉禾县| 攀枝花市| 藁城市| 墨竹工卡县| 汤原县| 奉化市| 岢岚县| 宝坻区| 汕尾市| 额敏县| 孟州市| 清河县| 乐安县| 陕西省| 玛多县| 格尔木市| 枝江市| 茌平县| 揭东县| 上饶县| 公主岭市| 靖安县| 精河县| 泸州市| 巴彦淖尔市| 郯城县| 扎鲁特旗| 江门市| 边坝县| 平昌县| 普宁市| 乳山市| 乳山市|