当前位置:网站首页>Encapsulation of tabbarcontroller
Encapsulation of tabbarcontroller
2022-07-26 09:49:00 【~ light boat ~】
First, create a class that inherits from UITabBarController
.m Implementation code in :
- (void)viewDidLoad {
[super viewDidLoad];
ViewController *firstVc = [[ViewController alloc] init];
[self addChildVc:firstVc title:@" Hello " image:@"mengmeng" selectedImage:@""];
SecondViewController *secondVc = [[SecondViewController alloc] init];
[self addChildVc:secondVc title:@"hello" image:@"jiyi" selectedImage:@""];
}
- (void)addChildVc:(UIViewController *)childVC title:(NSString *)title image:(NSString *)image selectedImage:(NSString *)selectedImage
{
childVC.title = title;// Simultaneous setting tabBar and navgationBar Words of
// Set the picture of the controller
childVC.tabBarItem.image = [UIImage imageNamed:image];
childVC.tabBarItem.selectedImage = [UIImage imageNamed:selectedImage];
// Set the navigation controller
UINavigationController *nav = [[UINavigationController alloc] initWithRootViewController:childVC];
// Add as sub controller
[self addChildViewController:nav];
}stay AppDelegate in
self.window.rootViewController = [[QZTabBarController alloc] init];That's all right.
边栏推荐
- 【Mysql数据库】mysql基本操作集锦-看得会的基础(增删改查)
- 电机转速模糊pid控制
- In the same CONDA environment, install pytroch first and then tensorflow
- JS判断数据类型 Object.prototype.toString.call和typeof
- 【信息系统项目管理师】初见高项系列精华汇总
- 系统安装Serv-U后IIS出错提示:HRESULT:0x80070020
- 青少年软件编程等级考试标准解读_二级
- IE7 set overflow attribute failure solution
- E. Two Small Strings
- R language ggplot2 visualization: align the legend title to the middle of the legend box in ggplot2 (default left alignment, align legend title to middle of legend)
猜你喜欢

服务器、客户端双认证(2)

Gauss elimination

B站这个视频我是跪着看完的

Alibaba cloud technology expert haochendong: cloud observability - problem discovery and positioning practice

挡不住了,纯国产PC已就位,美国的软硬件体系垄断正式被破

Keeping alive to realize MySQL automatic failover

2021年山东省中职组“网络空间安全”B模块windows渗透(解析)

regular expression
![Azkaban [basic knowledge 01] core concepts + features +web interface + Architecture +job type (you can get started with Azkaban workflow scheduling system in one article)](/img/f9/c86ccbb0967894d370498c3a9630eb.png)
Azkaban [basic knowledge 01] core concepts + features +web interface + Architecture +job type (you can get started with Azkaban workflow scheduling system in one article)

高斯消元
随机推荐
莫队学习笔记(一)
Write a script that can run in Bash / shell and PowerShell
Docker configuring MySQL Cluster
服务发现原理分析与源码解读
B站这个视频我是跪着看完的
学习笔记之常用数组api 改变原数组和不改变原数组的有哪些?
系统安装Serv-U后IIS出错提示:HRESULT:0x80070020
Interview shock 68: why does TCP need three handshakes?
How to add a PDB
解释一下自动装箱和自动拆箱?
EOJ 2020 January race E-number transformation
2019 ICPC Asia Yinchuan Regional(水题题解)
Learning notes: what are the common array APIs that change the original array or do not change the original array?
Fiddler packet capturing tool for mobile packet capturing
Apple dominates, Samsung revives, and domestic mobile phones fail in the high-end market
uni-app学习总结
电机转速模糊pid控制
正则表达式
解决npm -v突然失效 无反应
编写一个在bash / shell 和 PowerShell中均可运行的脚本