IOS7 - Why does the CGAffine Transform work correctly on iOS8 but not iOS7?

I am having trouble using CGAffineTransformMakeTranslation on iOS7. The view that I am using CGAffineTransformMakeTranslation will work in a different position when starting iOS7 and iOS8. Why is this and what am I doing wrong?

I have an idea of ​​what I call "hud", this is the length of its parentView and 125.0 tall. I use Auto Layout, and here is a screenshot of my story panel so you can see how my limits are set. A container view is a collection of photo views.

Storyboard

I have a β€œhud” strand right away with the conversion down, and when a photo is selected, it will slide back into view.

-(void)showHud:(BOOL)show { NSLog(@"Frame Height: %f", hud.frame.size.height); if (show && !hudSelectionMode) { [UIView animateWithDuration:0.5 delay:0 options:0 animations:^{ hud.transform = CGAffineTransformMakeTranslation(0, 0); hud.alpha = 0.8f; } completion:^(BOOL finished){ } ]; } else if (!show && !hudSelectionMode) { [UIView animateWithDuration:0.5 delay:0 options:0 animations:^{ hud.transform = CGAffineTransformMakeTranslation(0, hud.frame.size.height); hud.alpha = 0.8f; // will be 0.0 when not testing } completion:^(BOOL finished){ } ]; } } 

Here's the problem. On iOS8, this works flawlessly, and the hash is hidden from the very beginning and will slide when you select an image: Hud hiddenHud showing

However, when working on iOS7 devices, the hud is not where I would expect this: Hud ios7 "hidden"Hud ios7 showing

If I comment on all the code in - (void) showHud: (BOOL), it is shown that hud will sit at the bottom of parentView, where I expect it to be at 7 as well as at 8.

+6
source share
1 answer

On iOS7, you need to multiply the translation value by the scaleFactor device. On iOS8, this seems to be done automatically, but not on iOS7.

+2
source

Source: https://habr.com/ru/post/976384/


All Articles