簡潔易用的iOS引導(dǎo)頁制作
基本上每個(gè)app都有引導(dǎo)頁,雖然現(xiàn)在這種demo已經(jīng)比比皆是,但感覺都不全,所以自己整理了一個(gè),只需要傳入圖片,就可以正常加載出來。由于UIPageControl的小圓點(diǎn)大小和顏色經(jīng)常與UI設(shè)計(jì)的不相符,所以后面也會(huì)提到重寫類方法,進(jìn)行修改。
先看下效果(圖片是在網(wǎng)上隨便找的)
Untitled.gif
把指導(dǎo)頁圖片傳入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; }
如果小圓點(diǎn)不符合需求則在下面修改
currentColor傳入當(dāng)前圓點(diǎn)的顏色,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]; }
以上就是本文的全部內(nèi)容,希望對大家的學(xué)習(xí)有所幫助,也希望大家多多支持腳本之家。
- iOS App初次啟動(dòng)時(shí)的用戶引導(dǎo)頁制作實(shí)例分享
- iOS 引導(dǎo)頁的鏤空效果實(shí)例
- iOS基于UIScrollView實(shí)現(xiàn)滑動(dòng)引導(dǎo)頁
- iOS App引導(dǎo)頁開發(fā)教程
- 使用Swift代碼實(shí)現(xiàn)iOS手勢解鎖、指紋解鎖實(shí)例詳解
- 淺析IOS開發(fā)TouchID指紋解鎖功能
- 簡單實(shí)現(xiàn)iOS指紋解鎖(TouchID)
- iOS 指紋解鎖驗(yàn)證TouchID功能
- iOS實(shí)現(xiàn)啟動(dòng)引導(dǎo)頁與指紋解鎖的方法詳解
相關(guān)文章
iOS仿微信添加標(biāo)簽效果(shape實(shí)現(xiàn))
微信做的用戶體驗(yàn)非常棒,今天用shape來做下微信的標(biāo)簽功能,非常不錯(cuò),對ios 仿微信添加標(biāo)簽功能感興趣的朋友一起看看吧2016-11-11iOS App開發(fā)中Core Data框架基本的數(shù)據(jù)管理功能小結(jié)
除了使用SQL關(guān)系型數(shù)據(jù)庫,我們還可以使用Xcode中提供的Core Data來進(jìn)行表結(jié)構(gòu)數(shù)據(jù)處理,這里我們就來初步整理iOS App開發(fā)中Core Data框架基本的數(shù)據(jù)管理功能小結(jié):2016-06-06詳解Obejective-C中將JSON數(shù)據(jù)轉(zhuǎn)為模型的方法
這篇文章主要介紹了Obejective-C中JSON數(shù)據(jù)轉(zhuǎn)為模型的方法,同時(shí)介紹了使用jastor庫的方法,需要的朋友可以參考下2016-03-03