2013-07-01 29 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以避免模糊的图像。 –