0

I know that it works if I change the view's frame via the changing of a layer's transform (in this case it simply takes a view with all the subviews and works with it as if it is a single image). It is not good enough for me to use it because:

  1. It is too hard to calculate the appropriate position;
  2. I use HMLauncherView which has some logic based on frames not transforms.

I tried a lot of ways described here but it seems they are all for autolayout because none of them works. Depending on the type of the autoresizing mask some elements jump to their destination position and some of them are not affected at all or affected via strange ways.

How to solve such issue? Are there ways to solve this via an autoresizing mask?

EDITED

Animation code (the same result is for setting of center/bounds):

[UIView animateWithDuration:0.3 animations:^{

                lastLauncherIcon.layer.transform = CATransform3DIdentity;
                CGRect r = self.bounds;
                r.origin.y = MAX(0, MIN(self.scrollView.contentOffset.y, self.scrollView.contentSize.height - self.bounds.size.height));
                launcherIcon.frame = r;
            } completion:^(BOOL finished) {

                ...
            }];

The code of layoutSubviews seems to be extra because I have already tried to subclass UILabel which always jumps to the animation destination position. The investigation showed that the frame of this label is set when I set the view's frame/bounds only. In other cases label's setCenter, setFrame and setBounds are called when you call them directly.

This question is very similar but the suggested solution doesn't work for my case. I also found out I had broken something so the view with transformation doesn't appear on iOS 7.1 (maybe 7.x) but works on 8.3.

Community
  • 1
  • 1
Vyachaslav Gerchicov
  • 2,317
  • 3
  • 23
  • 49

0 Answers0