Quantcast
Channel: CSDN博客推荐文章
Viewing all articles
Browse latest Browse all 35570

iOS UIScrollView的简单使用

$
0
0


本文代码下载

http://vdisk.weibo.com/s/BDn59yfnBVMAJ  

//
//  ViewController.m
//  ScrollView_T1119
//
//  Created by 杜 甲 on 13-4-8.
//  Copyright (c) 2013年 杜 甲. All rights reserved.
//

#import "ViewController.h"

@interface ViewController ()

@end

@implementation ViewController

- (void)viewDidLoad
{
    [super viewDidLoad];
	// Do any additional setup after loading the view, typically from a nib.
    UIScrollView* scrollerView = [[UIScrollView alloc] initWithFrame:CGRectMake(0, 0, 320 , 548)];
    scrollerView.contentSize = CGSizeMake(800, 800);
    scrollerView.scrollEnabled = YES;
    scrollerView.delegate = self;
    scrollerView.bounces = NO;
    scrollerView.alwaysBounceHorizontal = YES;
    UIImageView *imageView=[[UIImageView alloc]initWithFrame:CGRectMake(0, 0, 800, 800)];
    [imageView setImage:[UIImage imageNamed:@"xiaonan.jpg"]];
    [scrollerView addSubview:imageView];
    [self.view addSubview:scrollerView];
    
 
}

- (void)didReceiveMemoryWarning
{
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

@end


作者:qqMCY 发表于2013-7-26 13:49:11 原文链接
阅读:51 评论:0 查看评论

Viewing all articles
Browse latest Browse all 35570

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>