分享

UIScrollView实现程序启动,使用说明效果

 昵称2735774 2014-09-15
    _scroll=[[UIScrollView alloc]initWithFrame:CGRectMake(0, 20, 320, 460)];
    _scroll.contentSize=CGSizeMake(320*4, 460);
    _scroll.pagingEnabled=YES;
    _scroll.bounces=NO;//不想让用户的滚动范围能够超出可见内容
    for(int i=1;i<5;i++)
    {
        UIImageView *imageView=[[UIImageView alloc]initWithFrame:CGRectMake(320*(i-1), 0, 320, 460)];
        NSString *path=[[NSBundle mainBundle]pathForResource:[NSString stringWithFormat:@"%d",i] ofType:@"png"];
        UIImage *img=[UIImage imageWithContentsOfFile:path];
        [imageView setImage:img];
        [_scroll addSubview:imageView];
        [imageView release];
        
    }
    
    
    UIButton *btn=[UIButton buttonWithType:UIButtonTypeCustom];
    btn.frame=CGRectMake(320*3, 0, 320, 460);
    [btn addTarget:self action:@selector(backhome) forControlEvents:UIControlEventTouchUpInside];
    [_scroll addSubview:btn];
    [self.view addSubview:_scroll];
    
    
}

    本站是提供个人知识管理的网络存储空间,所有内容均由用户发布,不代表本站观点。请注意甄别内容中的联系方式、诱导购买等信息,谨防诈骗。如发现有害或侵权内容,请点击一键举报。
    转藏 分享 献花(0

    0条评论

    发表

    请遵守用户 评论公约