iPhone上从下到上打开带有幻灯片效果的视图

6 iphone objective-c slide

我正在为iPhone(以横向模式运行)(OS 3.0)制作应用程序,我希望当我触摸工具栏按钮时,它会打开一个带有幻灯片效果的视图(类似于触摸'书签'时的效果Mobile Safari的工具栏)从屏幕的底部到顶部.该视图与按钮位于同一XIB文件中.

我怎样才能做到这一点?

提前致谢.

NWC*_*der 11

如果你问的是做动画自定义,这里有一个可能有帮助的片段.让我们假设视图"myView"已经作为子视图添加到当前视图中.

[myView setFrame:CGRectMake(0, 480, 320, 480)];
[myView setBounds:CGRectMake(0, 0, 320, 480)];

[UIView beginAnimations:nil context:NULL];
[UIView setAnimationDuration:1.0];
[UIView setAnimationDelegate:self];
[myView setFrame:CGRectMake(0, 0, 320, 480)];
[UIView commitAnimations];
Run Code Online (Sandbox Code Playgroud)

其中的重要数字是setFrame rect中的y位置(480然后是0),这会将其从屏幕外移动到屏幕上.


jbr*_*nan 7

[self.tabBarController presentModalViewController:yourSlideController animated:YES];
Run Code Online (Sandbox Code Playgroud)