#import "ViewController.h"
#import "ImageScrollView.h"
#import "RootViewController.h"
#import "AppDelegate.h"
@interface ViewController ()<ImageScrollViewDelegate>
@end
@implementation ViewController
- (void)viewDidLoad {
[super viewDidLoad];
//导航条背景颜色
[self.navigationController.navigationBar setBackgroundImage:[UIImage imageNamed:@"头"] forBarMetrics:(UIBarMetrics)UIBarMetricsDefault];
NSArray *imgName=@[@"guidePage1",@"guidePage2",@"guidePage3"];
CGRect confirmBtnFrame=CGRectMake(self.view.frame.size.width-200, 80, 150, 40);
ImageScrollView *guide=[[ImageScrollView alloc]initWithFrame:self.view.frame style:ImageScrollType_Guide images:imgName confirmBtnTitle:@"立即体验" confirmBtnTitleColor:[UIColor blackColor] confirmBtnFrame:confirmBtnFrame autoScrollTimeInterval:0 delegate:self];
//添加滚动视图
[self.view addSubview:guide];
//添加分页控件
[guide addPageControlToSuperView:self.view];
}
#import "RootViewController.h"
#import "ImageScrollView.h"
@interface RootViewController ()
@end
@implementation RootViewController
- (void)viewDidLoad {
[super viewDidLoad];
self.view.backgroundColor=[UIColor whiteColor];
NSArray *imarr=@[@"21394",@"21399",@"man1",@"man2",@"man3",@"man4"];
ImageScrollView *banner=[[ImageScrollView alloc]initWithFrame:CGRectMake(0, 0, self.view.frame.size.width, 100) style:ImageScrollType_Banner images:imarr confirmBtnTitle:nil confirmBtnTitleColor:nil confirmBtnFrame:CGRectZero autoScrollTimeInterval:1.5 delegate:self];
[self.view addSubview:banner];
// Do any additional setup after loading the view.
}
//创建导航控制器3
UINavigationController *nav3=[[UINavigationController alloc]initWithRootViewController:[[UIViewController alloc]init]];
//设置baritem3
nav3.tabBarItem=[[UITabBarItem alloc]initWithTitle:@"动态" image:[UIImage imageNamed:@"dongtai"] selectedImage:[UIImage imageNamed:@"dongtai_Highlighted"]];
//创建tabbar控制器
UITabBarController *tab=[[UITabBarController alloc]init];
[tab setViewControllers:@[nav1,nav2,nav3]];
//添加到视图
self.window.rootViewController=tab;
网友评论