当前位置:编程学习 > wap >>

IOS 图片轮播和开始的指导界面

开始的引导界面 借鉴了 code4app.com 上的 我更改了他的实现方式  用到他的 image分割
 图片轮播是我以前写的  轮播我设置了计时器 可自动下一张

现在分享出来


这是引导界面的用法

[cpp] 
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions 

    self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]]; 
    self.viewController = [[LKViewController alloc] initWithNibName:@"LKViewController" bundle:nil]; 
     
    NSMutableArray* dataArray = [NSMutableArray array]; 
    for (int i=1; i<=5; i++) { 
        //加载图片的完整路劲 
        [dataArray addObject:[[NSBundle mainBundle] pathForResource:[NSString stringWithFormat:@"welcome-%d",i] ofType:@"jpg"]]; 
    } 
    //怎么判断是第一次进入 可以有 判断文件 判断字段 等等方法 
    LKWelcomeView* welcome = [[LKWelcomeView alloc]initWithFrame:CGRectMake(0, 20, self.window.frame.size.width, self.window.frame.size.height-20) andPathArray:dataArray]; 
     
    [self.window addSubview:welcome]; 
    welcome.endEvent = ^(){ 
        //当要进入主程序 
        [self.window insertSubview:self.viewController.view atIndex:0]; 
    }; 
 
    [self.window makeKeyAndVisible]; 
    return YES; 

这是轮播的用法都很简单

[cpp]  www.zzzyk.com
- (void)viewDidLoad 

    NSMutableArray* pagearray = [NSMutableArray arrayWithCapacity:5]; 
    for (int i = 1 ; i <= 5; i++) { 
        [pagearray addObject:[[NSBundle mainBundle] pathForResource:[NSString stringWithFormat:@"page_%d",i] ofType:@"jpg"]]; 
    } 
     
    LKPageView* page = [[LKPageView alloc]initWithPathStringArray:pagearray andFrame:CGRectMake(0, 50, 320, 200)]; 
    [self.view addSubview:page]; 
    [super viewDidLoad]; 
    // Do any additional setup after loading the view, typically from a nib. 

补充:移动开发 , IOS ,
CopyRight © 2012 站长网 编程知识问答 www.zzzyk.com All Rights Reserved
部份技术文章来自网络,