登录 立即注册
金钱:

启动引导页 Demo

来自: survivorsfyh 分类: iOS精品源码 上传时间: 2016-6-12 15:57:25
Tag:引导页 滚动图 Guide View 启动图

项目介绍:

写了一个简单的小 demo,希望能给大家带来些小帮助.
调用较简便,内含一些注释.

主要代码:
[Objective-C] 查看源文件 复制代码
#import "AppDelegate.h"
#import "FYHMyTabBarVC.h"//TabBar
#import "FYHMyNavVC.h"//Nav
#import "FYHGuidePageVC.h"

@interface AppDelegate () {
    NSMutableArray *picArr;//启动图VC:图片 Arr 设置
    NSMutableArray *titleArr;//启动图VC:Btn 名字 Arr 设置
}

@end

@implementation AppDelegate

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
    // Override point for customization after application launch.
    self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
    self.window.backgroundColor = [UIColor whiteColor];
    
    [self createUI];
    [self.window makeKeyAndVisible];
    return YES;
}

- (void)createUI {
    /*
    FYHMyTabBarVC *tabBarCon = [[FYHMyTabBarVC alloc] init];
    
    //Add VCs
    [tabBarCon addViewControllersWithString:@"FYHFirstVC" Title:@"First" Image:@"DashboardTabBarItemSubscription" AndSelectedImg:nil];
    [tabBarCon addViewControllersWithString:@"FYHSecondVC" Title:@"Second" Image:@"DashboardTabBarItemDailyHot" AndSelectedImg:nil];
    [tabBarCon addViewControllersWithString:@"FYHSecondVC" Title:@"Third" Image:@"DashboardTabbarLife" AndSelectedImg:nil];
    [tabBarCon addViewControllersWithString:@"FYHSecondVC" Title:@"Four" Image:@"DashboardTabBarItemDiscussion" AndSelectedImg:nil];
     */
    
    /** 加载启动图与 Btn 名字 Arr 相关设置*/
    picArr = @[
               [UIImage imageNamed:@"guidePage_01"],
               [UIImage imageNamed:@"guidePage_02"],
               [UIImage imageNamed:@"guidePage_03"],
               [UIImage imageNamed:@"guidePage_04"]
               ].mutableCopy;
    titleArr = @[@"login", @"logon"].mutableCopy;
    [[FYHGuidePageVC sharedGuideVC] fyhGuidePageWithPicArr:picArr AndTitleArr:titleArr];
    
    /** Add VCs*/
    FYHMyNavVC *nav = [[FYHMyNavVC alloc] init];
    UINavigationController *nav1 = [[UINavigationController alloc] initWithRootViewController:[nav addViewControllersWithString:@"FYHFirstVC" Title:@"First" Image:@"DashboardTabBarItemSubscription" AndSelectedImg:nil]];
    UINavigationController *nav2 = [[UINavigationController alloc] initWithRootViewController:[nav addViewControllersWithString:@"FYHSecondVC" Title:@"Second" Image:@"DashboardTabBarItemDailyHot" AndSelectedImg:nil]];
    UINavigationController *nav3 = [[UINavigationController alloc] initWithRootViewController:[nav addViewControllersWithString:@"FYHThirdVC" Title:@"Third" Image:@"DashboardTabbarLife" AndSelectedImg:nil]];
    UINavigationController *nav4 = [[UINavigationController alloc] initWithRootViewController:[nav addViewControllersWithString:@"FYHFourVC" Title:@"Four" Image:@"DashboardTabBarItemDiscussion" AndSelectedImg:nil]];
    /** Add Navs*/
    NSArray *navArr = @[nav1, nav2, nav3, nav4];
    /** Add TabBar*/
    self.tabBar = [[UITabBarController alloc] init];
    self.tabBar.viewControllers = navArr;
    
    FYHGuidePageVC *guidePageVC = [FYHGuidePageVC sharedGuideVC];
    _window.rootViewController = guidePageVC;
}


代码下载:
FYHScroViewLogDemo.zip (1.11 MB, 下载次数: 317)
1004 0 0
代码贡献英雄榜
用户名 下载数
通过邮件订阅最新 Code4App 信息
上一条 /4 下一条
联系我们
关闭
合作电话:
13802416937
Email:
435399051@qq.com
商务市场合作/投稿
问题反馈及帮助
联系我们

广告投放| Github|申请友链|手机版|Code4App ( 粤ICP备15117877号-1 )

快速回复 返回顶部 返回列表