下面这个视图(多视图滑动点击切换)在很多App都有用到.使用封装过的view,外部调用一个API就可以实现,十分的方便。
git代码:https://github.com/HelloYeah/HYTabbarView.
//添加一个子控制器
| 代码如下 | 复制代码 |
| -(void)addSubItemWithViewController:(UIViewController *)viewController; | |
1.外部传一个控制器
| 代码如下 | 复制代码 |
| -(void)addSubItemWithViewController:(UIViewController *)viewController{ UIButton*btn=[UIButtonbuttonWithType:UIButtonTypeCustom]; [self.tabbar addSubview:btn]; [self setupBtn:btnwithTitle:viewController.title]; [btn addTarget:self action:@selector(itemSelected:)forControlEvents:UIControlEventTouchUpInside]; [self.subViewControllers addObject:viewController]; } | |
2.KVO监听当前选中View的序号值
| 代码如下 | 复制代码 |
|
NSInteger min = HYColumn / 2 ; | |
deepin20怎么新增字体? deepin20安装字体的教程
Linux如何给文件权限? linux给文件添加可执行权限的技巧
deepin20桌面图标样式怎么修改? deepin更换图标主题的技巧
virtualbox打不开虚拟机怎么办? linux无法访问virtualbox的解决办法
deepin怎么注销系统? deepin系统注销与切换用户的方法
Manjaro linux怎么调鼠标速度? Manjaro鼠标设置光标速度的技巧