【发布时间】:2014-10-16 16:53:46
【问题描述】:
我有一个动画来添加一个子视图,使它看起来好像来自用户触摸的内部,然后填满整个屏幕。
同样,当 iOS 应用从用户触摸的地方打开时..
- (void) showView : (UIView *) theview : (CGPoint) thepoint {
CGPoint c = thepoint;
CGFloat tx = c.x - floorf(theview.center.x) + 10;
CGFloat ty = c.y - floorf(theview.center.y) + 100;
[UIView animateWithDuration:0.5
delay:0.0
options:UIViewAnimationOptionCurveEaseOut
animations:^{
// Transforms
CGAffineTransform t = CGAffineTransformMakeTranslation(tx, ty);
t = CGAffineTransformScale(t, 0.1, 0.1);
theview.transform = t;
theview.layer.masksToBounds = YES;
[theview setTransform:CGAffineTransformIdentity];
}
completion:^(BOOL finished) {
}];
}
上面的代码做了,直到iOS8..在XCode5.1(iOS7 SDK)下构建
但从 iOS8 SDK、XCode6 开始,行为完全不同
ZOOM 现在的行为很奇怪。我终于能够在 iOS8 中发现 CGAffineTransformIdentity 的行为错误(或者我使用错误?)..
我看到很多人有这个问题,但他们提到了 AutoLayout。我所有的视图都是以编程方式创建的。我们不使用 nib 文件。(IB)
如何使用 XCode 6 进行这项工作?
【问题讨论】:
标签: ios objective-c ios8 xcode6 cgaffinetransform