2013-07-01 30 views
0

我正在做一個模塊,其中有一個引腳刪除功能。 針[圖像視圖]被放置在可縮放的滾動視圖上。 當縮放圖像視圖時,會根據其中心位置移動。問題與圖像查看orgin在ios

我想讓它與底點一起移動。

- (void)scrollViewDidEndZooming:(UIScrollView *)scrollView withView:(UIView *)view atScale:(float)scale; 
{ 
    zoomLevel=scale; 
    for (SSSmartPinView *smartPinView in smartPinViewMutArray) { 
     smartPinView.zoomScale = zoomLevel; 
     smartPinView.parrentOffset = drawingScrollView.contentOffset; 
     smartPinView.center = CGPointMake(([smartPinView.coresmartPin.xpoint floatValue]*zoomLevel),(([smartPinView.coresmartPin.ypoint floatValue]+(zoomLevel))*zoomLevel)); 



    } 


} 
- (void)scrollViewDidZoom:(UIScrollView *)scrollView{ 
    zoomLevel=scrollView.zoomScale; 
    for (SSSmartPinView *smartPinView in smartPinViewMutArray){ 
     smartPinView.zoomScale = zoomLevel; 
     smartPinView.parrentOffset = drawingScrollView.contentOffset; 

     smartPinView.center = CGPointMake(([smartPinView.coresmartPin.xpoint floatValue]*zoomLevel),(([smartPinView.coresmartPin.ypoint floatValue]+(zoomLevel))*zoomLevel)); 


    } 
} 

回答

1

您可以設置

smartPinView.layer.anchorPoint = CGPointMake(0.5, 1.0); 

(中心點旋轉/縮放)見anchorPoint財產

+1

你不希望把事情的像素邊界上,所以在最後一幀使用CGRectIntegral以避免模糊的圖像。 –