iOS - CATransition 和transitionWithView 问题
每当我使用 CATransition
或 transitionWithView
从右侧“推送”一个视图时,都会有一个短暂的时刻,被推送的视图会从黑色(或其他任何颜色)淡入背景颜色是),并且被推开的视图淡出为黑色。
这可能是预期的效果,但它在我的应用程序上看起来很混乱,并且想知道是否有人知道防止这种“淡出/淡入”效果的方法?
这是我用来呈现新视图的 CATransition 代码:
myView = [[MyView alloc] initWithNibName:@"MyView" bundle:nil];
[myView setDelegate:self];
[[mainView layer] addAnimation:pushRightTransition forKey:nil];
// Add the view:
[mainView addSubview:[myView view]];
Whenever I use either CATransition
or transitionWithView
to "push" one view from the right, there is a brief moment where the view that's getting pushed in fades in from black (or whatever the background color is), and the view that's getting pushed away fades out to black.
This might be the intended effect, but it looks messy on my app, and was wondering if anyone knows of a way to prevent this "fade out/in" effect?
Here is the CATransition code I am using to present the new view:
myView = [[MyView alloc] initWithNibName:@"MyView" bundle:nil];
[myView setDelegate:self];
[[mainView layer] addAnimation:pushRightTransition forKey:nil];
// Add the view:
[mainView addSubview:[myView view]];
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论