Download - iOS image and scrollview
Position and Size
Bounds: (origin, size) in local view coordinates
Frame: (origin, size) in containing view’s coordinates
Center: view’s center in containing view’s coordinates
Creating & Manage Views
UIView *aView = [[UIView alloc]initWithFrame:[window frame]];
[window addSubview:aView];
- (void)removeFromSuperview;
- (void)insertSubview:(UIView *)view atIndex:(NSInteger)index;
- (void)bringSubviewToFront:(UIView *)view;
Add Image
UIImageView &imageView = [[UIImageView alloc] initWithFrame:
self.view.bounds];
imageView.image = [UIImage imageNamed:"0.png"];
imageView.contentMode = UIViewContentModeScaleAspectFit;
[self.view addSubview:imageView];
Add ScrollView
UIScrollVview *scrollView = [[UIScrollView alloc] init];
scrollView.frame = self.view.bounds;
scrollView.contentSize = CGSizeMake(
self.view.frame.size.width*kPageNum, self.view.frame.size.height);
scrollView.pagingEnabled = YES;
[self.view addSubview:scrollView];