【问题标题】:Open view with slide effect from bottom to top on iPhone在 iPhone 上使用从下到上的幻灯片效果打开视图
【发布时间】:2010-11-21 16:37:54
【问题描述】:

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

我该怎么做?

提前致谢。

【问题讨论】:

    标签: iphone objective-c slide


    【解决方案1】:

    如果您想了解如何自定义动画,这里的 sn-p 可能会有所帮助。 让我们假设视图“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];
    

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

    【讨论】:

    • 它最适合在 iphone facebook 应用程序更多选项中应用 SlideView。
    【解决方案2】:
    [self.tabBarController presentModalViewController:yourSlideController animated:YES];
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2011-12-20
      • 2014-05-22
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多