2014-02-07 2 views
1

는 말 그대로 코드의 가장 기본이 있고 나는 그것을 확대하지 않을 이유에 너무 기진 맥진 해요 : 나는 모든 일에 확대하지 않고 아무것도하려고 시뮬레이터에서UIScrollView에 포함 된 UIImageView를 확대/축소 할 수없는 이유는 무엇입니까?

- (void)viewDidLoad 
{ 
    [super viewDidLoad]; 

    self.scrollView = [[UIScrollView alloc] initWithFrame:CGRectMake(0.0, 0.0, CGRectGetWidth([UIScreen mainScreen].bounds), CGRectGetHeight([UIScreen mainScreen].bounds))]; 
    self.scrollView.delegate = self; 
    self.scrollView.contentSize = self.imageView.bounds.size; 
    self.scrollView.minimumZoomScale = 0.5; 
    self.scrollView.maximumZoomScale = 10.0; 

    [self.view addSubview:self.scrollView]; 

    self.imageView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"community1.jpeg"]]; 
    self.imageView.contentMode = UIViewContentModeScaleAspectFit; 

    [self.scrollView addSubview:self.imageView]; 
} 

. 관련성이있는 경우 다소 큰 이미지입니다.

답변

1

-viewForZoomingInScrollView:을 스크롤보기의 위임에 구현 했습니까? 그렇지 않다면, 당신은 핀치했을 때 실제로 줌하고자하는 뷰를 돌려 주어야합니다.

관련 문제