自从我一直在寻找如何制作如上所述的动画以来已经过了几个小时.到目前为止,我已经通过honcheng 找到了这个折叠导航,这很酷.但是,我想要的比这更简单.谷歌地图从右侧出来的方式,这就是我希望减去翻页效果.不知何故,喜欢iPad的Pulse新闻的方式也很棒.
所以,是的,如果有人这样做了,你能否提出一些关于如何学习这个的想法.或者也许是一个我可以看到的开源,并改为进行逆向工程.
这应该对你有帮助,但请记住,我对Pulse中使用的动画不是很熟悉.
.h声明一个UIView命名的secondView.
- (void)viewDidLoad
{
[super viewDidLoad];
secondView = [[UIView alloc] initWithFrame:CGRectMake(320, 0, 320, 480)];
[secondView setBackgroundColor:[UIColor redColor]];
[self.view addSubview:secondView];
}
- (IBAction)myAction:(id)sender
{
[UIView animateWithDuration:0.45 animations:^{
if (secondView.transform.tx == 0) {
[secondView setTransform:CGAffineTransformMakeTranslation(-200, 0)];
}else{
[secondView setTransform:CGAffineTransformMakeTranslation(0, 0)];
}
}];
}
Run Code Online (Sandbox Code Playgroud)
然后只需将此操作链接到一个不会被新的传入视图阻止的按钮!