【问题标题】:making the uipagecontrol animation look like uinavigationcontrol animation使 uipagecontrol 动画看起来像 uinavigationcontrol 动画
【发布时间】:2013-10-27 20:19:25
【问题描述】:

我使用的是ui页面控件的概念。

例如,我有多个相似的观点。假设 10 篇新闻文章。我将它们放在一个页面控件中,并且能够在它们之间滑动。

但是,我想模仿 UINavController 所做的动画。这可能吗?即:不是让页面从头到尾滚动,而是有轻微的重叠和效果,其中一个面板以两倍于其下方滑入的速度滑出。

有什么想法吗?

【问题讨论】:

  • UIPageControl 没有任何与之关联的动画或过渡。您实际使用什么来制作动画?
  • 你真的在使用 UIPageViewController 吗?我猜你把它误认为 UIPageControl 不是任何类型的容器。

标签: ios objective-c animation uinavigationcontroller uipagecontrol


【解决方案1】:

如果我没有误解你的问题.. 由于现有页面控件无法做到这一点,因此您需要自己的逻辑 这是应该如何处理的,您需要根据您的要求进行调整..

粗略的逻辑

[self.view addSubview:nextArticleView];
nextArticleView.frame = // set offscreen frame, in the direction you want it to appear from

//设置更多时间,因为 newArticle 应该与现有文章视图重叠

[UIView animateWithDuration:10.0 
      animations:^{
                nextArticleView.frame = // desired end location (current articles initial frame)
                  }];

//设置更少的时间,因为当前文章应该快速滑动

[UIView animateWithDuration:5.0 
      animations:^{
                self.view.frame = // desired end location (off screen)
                  }];

【讨论】:

    猜你喜欢
    • 2014-03-27
    • 1970-01-01
    • 2011-04-19
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多