且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

翻转查看Iphone

更新时间:2023-11-10 10:15:40

这可能是因为您没有使用容器视图作为转换视图。请参阅 setAnimationTransition:forView:cache:

It's probably because you aren't using a container view as the transition view. Refer to the documentation on setAnimationTransition:forView:cache:


如果你想改变外观转换期间的视图 - 例如,从一个视图翻转到另一个视图 - 然后使用容器视图,UIView的实例,如下所示:

If you want to change the appearance of a view during a transition—for example, flip from one view to another—then use a container view, an instance of UIView, as follows:


  1. 开始动画块。

  2. 在容器视图上设置转换。

  3. 从容器视图中删除子视图。

  4. 将新的子视图添加到容器视图。

  5. 提交动画块。

  1. Begin an animation block.
  2. Set the transition on the container view.
  3. Remove the subview from the container view.
  4. Add the new subview to the container view.
  5. Commit the animation block.


showMoreInfo的动画转换视图中尝试使用 self.view.superview

showLessInfo:方法的工作原理是您正在使用容器视图。

The reason the showLessInfo: method works is you are using a container view.