zoukankan      html  css  js  c++  java
  • delegate

     1 //
     2 //  ViewController.m
     3 //  11-1UiscrollViewdelegate
     4 //
     5 //  Created by zjj on 15/5/13.
     6 //  Copyright (c) 2015年 zjj. All rights reserved.
     7 //
     8 
     9 #import "ViewController.h"
    10 
    11 @interface ViewController () <UIScrollViewDelegate>
    12 {
    13     UIImageView *_imgView;
    14 }
    15 @end
    16 
    17 @implementation ViewController
    18 
    19 - (void)viewDidLoad {
    20     [super viewDidLoad];
    21     UIScrollView *scroView = [[UIScrollView alloc]init];
    22     scroView.frame = self.view.bounds;
    23     [self.view addSubview:scroView];
    24     
    25     UIImage *img = [UIImage imageNamed:@"11.jpg"];
    26     _imgView = [[UIImageView alloc]initWithImage:img];
    27     [scroView addSubview:_imgView];
    28     
    29     scroView.contentSize = img.size;
    30     scroView.delegate = self;
    31     scroView.minimumZoomScale = 0.2;
    32     scroView.maximumZoomScale = 2;
    33     
    34 }
    35 
    36 - (UIView *)viewForZoomingInScrollView:(UIScrollView *)scrollView
    37 {
    38     return _imgView;
    39 }
    40 
    41 @end
  • 相关阅读:
    VBA.replace替换单引号或双引号
    读取文件
    UPDATE
    alter update
    SQL日期格式
    python map的用法
    python os模块用法
    python re.I compile search
    python 正则匹配
    通过list中值得名称查询索引号
  • 原文地址:https://www.cnblogs.com/zhangdashao/p/4499210.html
Copyright © 2011-2022 走看看