UITableView in UINavigationController gets under Navigation Bar after rotation

前端 未结 8 877
清酒与你
清酒与你 2020-12-21 06:10

This is Portrait:

This is Landscape

I\'ve tried this on rotation with no success:

self.tableView.autoresizesSubviews = YE         


        
8条回答
  •  陌清茗
    陌清茗 (楼主)
    2020-12-21 06:53

    This problem can occur if you've called "willAnimateRotationToInterfaceOrientation:" in your navigation controller, but forgotten to call super from within the method.

    You should have something like this:

            - (void)willAnimateRotationToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation duration:(NSTimeInterval)duration {
            [super willAnimateRotationToInterfaceOrientation:toInterfaceOrientation];
    // Your code here
    
        }
    

提交回复
热议问题