引导页的铺设
来源:互联网 发布:js自定义属性data 编辑:程序博客网 时间:2024/04/29 06:13
@property (nonatomic,retain) UIPageControl *page;
// 要先判断是否是第一次启动(一般都是看当前版本是否是第一次启动)
if (![[NSUserDefaultsstandardUserDefaults] boolForKey:@"everLaunched"]) {
[[NSUserDefaultsstandardUserDefaults] setBool:YESforKey:@"everLaunched"];
[[NSUserDefaultsstandardUserDefaults] setBool:YESforKey:@"firstLaunch"];
/* scrollView处理 */
UIScrollView *myScroll = [[UIScrollViewalloc] initWithFrame:CGRectMake(0,0, 375 * WIDTH, 667 * HEIGH)];
myScroll.contentSize =CGSizeMake(375 *WIDTH * 3, 667 * HEIGH);
for (int i =0; i < 3; i++) {
UIImageView *myImage = [[UIImageViewalloc] initWithFrame:CGRectMake(375 *WIDTH * i, 0,375 * WIDTH,667 * HEIGH)];
myImage.image = [UIImageimageNamed:[NSStringstringWithFormat:@"引导图%d", i +1]];
[myScrolladdSubview:myImage];
}
myScroll.pagingEnabled =YES;
myScroll.showsHorizontalScrollIndicator =NO;
myScroll.bounces =NO;
[self.windowaddSubview:myScroll];
/* 最后一个页面设置一个button */
UIButton *button = [UIButtonbuttonWithType:(UIButtonTypeCustom)];
[myScrolladdSubview:button];
// button.backgroundColor = [UIColor orangeColor];
button.frame =CGRectMake(self.window.frame.size.width *2 + self.window.frame.size.width /2 - 100 * WIDTH, self.window.frame.size.height -215 * HEIGH,200, 100);
button.tintColor = [UIColorblackColor];
button.titleLabel.font = [UIFontsystemFontOfSize:20];
[button addTarget:selfaction:@selector(click)forControlEvents:(UIControlEventTouchUpInside)];
[button setTitle:@""forState:UIControlStateNormal];
/* 签订协议 */
myScroll.delegate =self;
/* 页面处理 */
self.page = [[UIPageControlalloc] initWithFrame:CGRectMake(0,620 * HEIGH,375*WIDTH, 30)];
self.page.numberOfPages =3;
self.page.currentPage =0;
self.page.backgroundColor = [UIColorclearColor];
self.page.currentPageIndicatorTintColor = [UIColorcyanColor];
self.page.pageIndicatorTintColor = [UIColorwhiteColor];
[self.windowaddSubview:self.page];
}else {
[[NSUserDefaultsstandardUserDefaults] setBool:NOforKey:@"firstLaunch"];
self.window.rootViewController =self.sideMenuVC;
}
/* button的点击方法,处理跳转 */
- (void)click
{
self.window.rootViewController =self.sideMenuVC;
}
/* 页面移动处理 */
- (void)scrollViewDidScroll:(UIScrollView *)scrollView
{
self.page.currentPage = scrollView.contentOffset.x / scrollView.window.frame.size.width;
}
- 引导页的铺设
- RFC149 最好的铺设计划
- 管道铺设施工的最佳方案选择
- UMA铺设蜂窝网络和WLAN的融合之路
- 实验三:[图]管道铺设施工的最佳方案问题
- 电商市场的全面铺设,农村淘宝开始升级
- 引人入胜的引导页
- 引导页的介绍
- 好看的引导页
- 引导页的使用
- 引导页的显示
- 引导页的实现
- 漂亮的引导页风格
- 网站的引导页是什么?
- 引导页GuideViewController的写法
- IOS引导页的编写
- 关于引导页的设置
- 简单的iOS引导页
- 哈哈 一个小程序
- button初始化类目
- GreenDao的使用
- Java简单彩票系统(35选7)
- HDU-2732 Leapin's Lizards
- 引导页的铺设
- UIView
- 写一个网络图片查看器
- 屌屌的Web树--保存分类
- codeforce Bubble Cup 8 - Finals G Run for beer
- ARC,MRC理解
- A Few Useful Things to Know About Machine Learning
- 在Unity3D中控制动画播放
- 三步搞定浏览器