为什么PageControl项目中没有动画?
我正在使用 PageControl 项目,该项目位于 Apple 的开发网站上。我已向项目添加了一个翻转视图,并在每个视图/页面的右上角添加了一个信息图标。由于某种原因,只有第一页能够设置翻转动画。第 2 页仍然显示翻转的页面,但没有动画。为了确保第 1 页没有什么特别之处,我切换了第 1 页和第 2 页,效果很好。位置 1 中的页面 2 有动画,而位置 2 中的页面 1 没有动画。任何想法为什么会发生这种情况或者我如何解决它?
我确实看过这个帖子,这似乎是同一个问题:Flip View Iphone。但是,我的 Flipview 是一个 UIViewController,其上带有信息图标的类也是如此。在另一个线程中,他们正在使用 UIView。
我确实实现了上面线程中的 showInfo 代码。当我翻到第二页时,我没有看到任何翻转。然后我滚动到第 1 页,发现它已翻转。不知道为什么它没有留在第 2 页。在第 1 页上时,它不会为翻转设置动画。翻转视图突然出现。
I'm using the PageControl project, which is on Apple's dev site. I've added a flip view to the project and an info icon to the top right of each view/page. For some reason, only the first page is able to animate the flipping. Page 2 on still shows the flipped page but does not animate. To make sure it isn't anything special about page 1, I switch page 1 and 2 and that worked fine. Page 2 in position 1 animated while Page 1 in position 2 did not. Any ideas why this would happen or how I can trouble shoot it?
I did take a look at this thread, which seems to be the same issue: Flip View Iphone. However, My flipview is a UIViewController and so is the class with the info icon on it. In the other thread, they are using UIViews.
I did implement the showInfo code from the above thread. When on Page 2, I see no flip. Then I scroll over to Page 1 and see it has flipped. Not sure why it isn't staying with Page 2. When on Page 1, it doesn't animate the flip. The flipview just suddenly appears.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
你有容器视图吗?有什么东西可以在那里添加和删除子视图吗?如果您有两个 viewController,一来一去,而没有 containerView,则动画可能会中断。我使用 rootViewController 并使用后面的 rootViewcontroller 将所有页面相互动画化。这是我的翻转代码,您可能需要进行一些编辑才能使其适合您:(
请记住 self 是 rootViewcontroller,一个具有空白视图的视图控制器(对其进行着色以使其与您的视图相匹配))
Do you have a containerView? Something that can be there so you can add and remove subviews from it? Animation can break if you have two viewControllers, one coming and one going, without a containerView. I use a rootViewController and animate all my pages to and from each other with the rootViewcontroller in the back. Here is my code for flipping, you'll probably have to do a little editing to make it work for you:
(keep in mind that self is the rootViewcontroller, a viewcontroller with a blank view (color it so it matches your views))