2012-07-06 109 views
1

目標:縮放後。在scrollView中調整圖像的大小?如何在縮放後在imageView中調整圖像大小?

我在scrollView裏面有一個imageView。當我放大圖像時,我把另一個圖像放在imageView的imagePicker它已經放大。我希望當我在imageView中選擇另一個圖像時,它適合屏幕顯示。我嘗試幾個代碼

 CGSize scrollSize = scroll.frame.size; 
     [scroll setContentSize:scrollSize]; 
     imageView.contentMode = UIViewContentModeScaleToFill; 

但它不適合我。

由於

第一次圖像enter image description here

縮放圖像之後是enter image description here

當我再次拿起由imagePicker圖像的圖像是enter image description here

回答

0

使用以下codeinto滾動視圖委託方法

[scrNxt setZoomScale:1 animated:NO];

下面的例子。

-(void)scrollViewDidScroll:(UIScrollView *)scrollView{ 
    if(scrollView==self.scr){ 
        [scrNxt setZoomScale:1 animated:NO]; 

} 

這可能會解決你的問題

相關問題