IOS学习之 -- UIScrollView
作者:
就怕是个demo | 来源:发表于
2015-11-20 19:36 被阅读31次#import "ViewController.h"
@interface ViewController ()
@property (strong, nonatomic) IBOutlet UIScrollView *myScorllView;
@property (strong, nonatomic) IBOutlet UIImageView *image;
@end
@implementation ViewController
- (void)viewDidLoad {
[super viewDidLoad];
// Do any additional setup after loading the view, typically from a nib.
self.image = [[UIImageView alloc]initWithImage:[UIImage imageNamed:@"a.jpg"]];
self.myScorllView = [[UIScrollView alloc]initWithFrame:self.view.bounds];
//重要的一项设置
self.myScorllView.contentSize = self.image.bounds.size;
[self.myScorllView addSubview:self.image];
[self.view addSubview:self.myScorllView];
}
- (void)didReceiveMemoryWarning {
[super didReceiveMemoryWarning];
// Dispose of any resources that can be recreated.
}
@end
本文标题:IOS学习之 -- UIScrollView
本文链接:https://www.haomeiwen.com/subject/lqwlhttx.html
网友评论