我在iOS7上使用CGAffineTransformMakeTranslation时遇到问题.在运行iOS7和iOS8时,我使用CGAffineTransformMakeTranslation的视图将处于不同的位置.为什么这样,我做错了什么?
我有一个观点,我称之为"hud",即其parentView和125.0高的长度.我正在使用自动布局,这是我的故事板的屏幕截图,所以你可以看到我如何设置约束.容器视图是照片的集合视图.

我将"hud"隐藏起来,向下转换,当选择一张照片时,它会滑回到视图中.
-(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){
}
];
}
}
Run Code Online (Sandbox Code Playgroud)
这是问题
在iOS8上,这完美无缺地将hud从一开始就隐藏起来,并在选择图像时向上滑动:

但是,当在iOS7设备上运行时,hud不是我期望的那样:

如果我注释掉所有代码 - (void)showHud:(BOOL)显示hud将位于parentView的底部,我希望它在7和8上.