iOS UIScrollView的简单使用
来源:未知 责任编辑:责任编辑 发表时间:2014-01-26 21:59 点击:次
// // 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
相关新闻>>
- 发表评论
-
- 最新评论 更多>>
今日头条
更多>>您可能感兴趣的文章
- ios学习笔记(二)xcode 4.3.2下实现基本交互
- Lexical or Preprocessor Issue 'xxx.h
- Memory on the iPhone
- iPhone开发学习笔记006—— NSNotification自定义通知名
- 多线程之NSInvocationOperation
- iPhone应用开发之十一:常用的三种动画表现效果
- ios开发问题:添加库和复制其它工程文件编译错误问题
- iphone开发之object c基础一定义接口
- (iPhone/iPad开发)presentViewController相应方法在SDK5.0前后
- Android:实现TabWidget选项卡按钮在屏幕下方