主控制器 ,管理控制器 .h文件
//宏
#define kScreenWidth [UIScreen mainScreen].bounds.size.width
#define kScreenHeight [UIScreen mainScreen].bounds.size.height
#import "MYMainViewController.h"
#import "MYFirstViewController.h"
#import "MYSecondViewController.h"
#import "MYThirdViewController.h"
@interface MYMainViewController ()<UIScrollViewDelegate>
//控制器名
@property (nonatomic, strong) NSArray *VcNames;
//选择栏
@property(nonatomic, strong) UIView *clickBar;
//底部容器scrollView
@property (strong, nonatomic) UIScrollView *containerScrollerView;
@end
. m 文件
底部scrollView , 用于滑动
@implementation MYMainViewController
- (UIScrollView *)containerScrollerView
{
if (!_containerScrollerView) {
_containerScrollerView = [[UIScrollView alloc]init];
_cont

本文详细介绍了在iOS开发中如何实现多控制器之间的滑动切换效果,包括主控制器的设置、底部scroll view的配置、初始化顶部选择栏、加载子控制器的UI以及按钮点击事件的代理方法实现。通过这些步骤,可以创建一个动态滑动切换的用户界面。
最低0.47元/天 解锁文章
2409

被折叠的 条评论
为什么被折叠?



