문제

I have several subviews added to a UIScrollview. Every thing works fine when swiping left and right, ie the subviews move with the swipe. When I use the pinch gestures the subviews do not zoom in and out with the other contents of the scrollview. Everything drawn in context works fine but the subviews remain the same size but move I think based on the movement of their origins, off screen for example if pinching out.

I am calling...

[scrollView setAutoresizesSubviews:YES];

on viewDidLoad. I have also called...

subView.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeigh 

for each subview added.

What am I dong wrong, or is this not the way to do it?

도움이 되었습니까?

해결책

Have you declared the delegate functions to resize the view when it is called ?

- (UIView *)viewForZoomingInScrollView:(UIScrollView *)scrollView;

- (void)scrollViewWillBeginDragging:(UIScrollView *)scrollView;

- (void)scrollViewDidEndZooming:(UIScrollView *)scrollView withView:(UIView *)view atScale:(float)scale;
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top