编辑:我找到了自己的问题的答案.请查看我帖子的底部.
我有一个动画的问题试图推动一个UIViewController在didSelectRowAtIndexPath上一个UITableView程序.当我在iOS 6中运行此代码时,它工作正常.在iOS 7中,动画混乱(它向左移动约20%的屏幕,然后消失).如果我在故事板中这样做动画很好.我是否遗漏了某些东西,或者在没有使用故事板的情况下有办法吗?
// This is a cut down example.
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
UIViewController *viewController = [[UIViewController alloc] init];
[self.navigationController pushViewController:viewController animated:YES];
}
Run Code Online (Sandbox Code Playgroud)
这就是tableView消失之前的样子.我明白为什么会这样做.这是因为推送的新视图应该像使用故事板时那样在其上滑动.由于某种原因,它不能以编程方式工作.

编辑:这是我错过的所有 由于某种原因你必须设置backgroundColor.
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
UIViewController *viewController = [[UIViewController alloc] init];
[viewController.view setBackgroundColor:[UIColor orangeColor]];
[self.navigationController pushViewController:viewController animated:YES];
}
Run Code Online (Sandbox Code Playgroud)