UIView转换到相同的视图

Cla*_*aus 3 transition uitableview uiview uiviewanimationtransition ios

我有一个UITableView控制器显示静态tableview.我必须更新项目,提供一个辅助模式,它tableview应该翻转并显示不同的数据.我的方法是将两种模式的所有静态单元放在一个大的静态中tableview,执行翻转并隐藏在特定时刻不需要的单元.翻转应仅在其上执行tableviewcontrollerview,因此不会影响navigationbar或主要tabbar.到目前为止,我一直试图用来实现这个简单的魔术的代码是:

// Transition using a page flip.
    [UIView transitionFromView:self.tableview
                        toView:self.tableview
                      duration:0.7
                       options:UIViewAnimationOptionTransitionFlipFromLeft
                    completion:^(BOOL finished) {
                        if (finished) {
                           /* HIDE NOT REQUIRED CELL */

                        }
                }];
Run Code Online (Sandbox Code Playgroud)

不幸的是结果是黑屏.知道怎么解决吗?

Rak*_*esh 7

请尝试使用以下代码:

[UIView transitionWithView:self.tableView 
                   duration:0.7
                   options:UIViewAnimationOptionTransitionFlipFromLeft 
                   animations:^{
                          /* any other animation you want */
                  } completion:^(BOOL finished) {
                          /* hide/show the required cells*/
                  }];
Run Code Online (Sandbox Code Playgroud)