I have a big content view within UIScrollVie开发者_Python百科w that contains subviews. When I zoom, I want to keep frames of that subviews unchanged. In my current solution I use the following: I override setTransform in my content view and for each subview I apply inverted transform as follows:
- (void)setTransform:(CGAffineTransform)newValue {
for (SubView *subView in self.subviews) {
subView.transform = CGAffineTransformInvert(newValue);
}
[super setTransform:newValue];
}
it works for my subviews sizes (frame.size.), but I always have some small (sometimes not small) offset in frame.origin. of my subviews.
How should I calculate correct frame.origin for my subviews? I need to get the same functionality as in maps application when after zoom we have the same initial position of annotation view.
Thanks
精彩评论