这篇文章主要为大家详细介绍了iOS引导页的制作方法,可满足一般设计的需求,具有一定的参考价值,感兴趣的小伙伴们可以参考一下
基本上每个app都有引导页,虽然现在这种demo已经比比皆是,但感觉都不全,所以自己整理了一个,只需要传入图片,就可以正常加载出来。由于UIPageControl的小圆点大小和颜色经常与UI设计的不相符,所以后面也会提到重写类方法,进行修改。
先看下效果(图片是在网上随便找的)

Untitled.gif
把指导页图片传入guideImages中
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
NSArray* guideImages = @[@"welcomePage_1",@"welcomePage_2",@"welcomePage_3"];
AppInstructionView* guide = [[AppInstructionView alloc]initWithFrame:CGRectMake(0, 0, ScreenWidth, ScreenHeight)];
guide.guideImages = guideImages;
[guide rewritePageControl];
[self.window.rootViewController.view addSubview:guide];
return YES;
}
如果小圆点不符合需求则在下面修改
currentColor传入当前圆点的颜色,nextColor传入其他的颜色,size表示大小
#pragma mark - 重写pageControl方法
-(void)rewritePageControl{
_pc = [[CHPageControl alloc]initWithFrame:CGRectMake(_pageSize.width * 0.5, _pageSize.height - 50, 0,0) currentColor:COLOR(72.0, 160.0, 220.0, 1) nextColor:COLOR(99.0, 99.0, 99.0, 1) size:8];
[_pc setBackgroundColor:[UIColor clearColor]];
_pc.userInteractionEnabled=NO;
[_pc setCurrentPage:0];
[_pc setNumberOfPages:_guideImages.count];
[self addSubview:_pc];
}
以上就是本文的全部内容,希望对大家的学习有所帮助,也希望大家多多支持编程学习网。
织梦狗教程
本文标题为:简洁易用的iOS引导页制作
基础教程推荐
猜你喜欢
- 解决Android Studio突然不显示logcat日志的问题 2023-02-04
- Android多返回栈技术 2023-04-15
- Android开发使用RecyclerView添加点击事件实例详解 2023-06-15
- Android中的webview监听每次URL变化实例 2023-01-23
- iOS开发教程之XLForm的基本使用方法 2023-05-01
- IOS 播放系统提示音使用总结(AudioToolbox) 2023-03-01
- Flutter绘图组件之CustomPaint使用详解 2023-05-12
- IOS应用内跳转系统设置相关界面的方法 2022-11-20
- Flutter手势密码的实现示例(附demo) 2023-04-11
- android studio按钮监听的5种方法实例详解 2023-01-12
