zoukankan      html  css  js  c++  java
  • 01-09 引导页(代码 1 )

      

    //

    //  GuideViewController.m

    //  XuanMiLaywer

    //

    //  Created by MYMAc on 15/7/30.

    //  Copyright (c) 2015 zhiyou. All rights reserved.

    //

     

     

    #import "GuideViewController.h"

    #import "AppDelegate.h"

    #import "LoginViewController.h"

     

    @interface GuideViewController ()<UIApplicationDelegate>

    {

        NSArray * imageArr;

        UIImageView *imageview;

        UIScrollView *scrollView ;

     

    }

    @end

     

    @implementation GuideViewController

     

     

     

     

    - (void)viewDidLoad {

        [super viewDidLoad];

     

       [[self navigationController] setNavigationBarHidden:YES animated:NO];

       imageArr = [[NSArray alloc]initWithObjects:@"gdyidaoye1", @"gdyidaoye2", @"gdyidaoye3",nil];

        

        [self initView];

        [self prefersStatusBarHidden];

    }

     

    #pragma mark  主页面

    -(void)initView

    {

       scrollView = [[UIScrollView alloc] initWithFrame:CGRectMake(0, 0, SCREEN_WIDTH, SCREEN_HEIGHT)];

        scrollView.showsVerticalScrollIndicator=NO;

        scrollView.showsHorizontalScrollIndicator=NO;

        [scrollView setContentSize:CGSizeMake(SCREEN_WIDTH * 3, 0)];

        [scrollView setPagingEnabled:YES];  //视图整页显示

           [scrollView setBounces:NO]; //避免弹跳效果,避免把根视图露出来

        for (int i = 0; i < imageArr.count; i ++) {

            imageview = [[UIImageView alloc] initWithFrame:CGRectMake(SCREEN_WIDTH * i, 0, SCREEN_WIDTH, SCREEN_HEIGHT)];

            imageview.image=[UIImage imageNamed:[NSString stringWithFormat:@"%@",imageArr[i]]];

            imageview.userInteractionEnabled = YES;

            [scrollView addSubview:imageview];

        }

        

        UIButton *button = [UIButton buttonWithType:UIButtonTypeCustom];

        button.frame=CGRectMake(SCREEN_WIDTH/2-50, SCREEN_HEIGHT-40, 100, 30);

    //    [button setBackgroundImage:[UIImage imageNamed:@"yindaoBg"] forState:UIControlStateNormal];

    //    [button setBackgroundImage:[UIImage imageNamed:@"yindaoBg"] forState:UIControlStateHighlighted];

        [button addTarget:self action:@selector(firstpressed) forControlEvents:UIControlEventTouchUpInside];

        [button setTitleColor:RGB(60, 199, 192) forState:UIControlStateNormal];

        button.backgroundColor = [UIColor whiteColor];

        button.layer.masksToBounds = YES;

        button.layer.cornerRadius = 5;

        [button setTitle:@"开始体验" forState:UIControlStateNormal];

        [imageview addSubview:button];

        

        

        [self.view addSubview:scrollView];

        

        

    }

    - (void)firstpressed

    {

        

        NSUserDefaults *userdefa =[NSUserDefaults standardUserDefaults];

        [userdefa setBool:YES forKey:@"MMIsFirst"];

        [userdefa synchronize];

        AppDelegate * appdelegatee = [UIApplication sharedApplication].delegate;

    //    BaseTB =[[BaseTBViewController alloc]init];

        

    //     appdelegatee.window.rootViewController  = BaseTB;

        //点击button跳转到根视图

    //    AppDelegate * appdelegatee = [UIApplication sharedApplication].delegate;

    //    [self presentViewController:appdelegatee.tabBar animated:YES completion:^

    //    {

    //

    //         appdelegatee.window.rootViewController =appdelegatee.tabBar;

    //        

    //    }];

        LoginViewController *log=[[LoginViewController alloc]init];

        

        UINavigationController *logNav=[[UINavigationController alloc]initWithRootViewController:log];

        appdelegatee.window.rootViewController =logNav;

        

    }

    - (BOOL)prefersStatusBarHidden

    {

        return YES;

    }

    - (void)didReceiveMemoryWarning {

        [super didReceiveMemoryWarning];

        // Dispose of any resources that can be recreated.

    }

     

     

    @end

  • 相关阅读:
    小白自动化测试指南
    分布式性能测试框架用例方案设想(二)
    高QPS下的固定QPS模型
    测试自动化最佳实践【译】
    moco框架接口命中率统计实践
    基于docker的分布式性能测试框架功能验证(一)
    编写高质量代码:Web前端开发修炼之道(一)
    JavaScript中点操作符和中括号操作符区别
    Vue脚手架生成及配置
    Npm设置淘宝镜像
  • 原文地址:https://www.cnblogs.com/gzz2016/p/5115738.html
Copyright © 2011-2022 走看看