A space appears above the view of the UITableViewController that you added to the iOS UIViewController container view.

Asked 2 years ago, Updated 2 years ago, 138 views

When you add a TableViewController to the ViewController container view (connected by Embedded in Segue), the status bar and navigation bar are blank at the top.
That's why I changed the container view area to the bottom of the navigation bar to cover all ViewController views.
However, if you display another TableViewController view in the container view, there will be no space at the top and it will overlap with the bar as shown in the picture below.
Enter a description of the image here

I'd like to make ViewController a container view and switch between two TableViewControllers, but how can I change the settings to create a gap at the top?

ios uitableview

2022-09-30 20:59

1 Answers

I was able to solve this problem by referring to the answers here.

in the container view controller viewDidLoad self.automaticallyAdjustsScrollViewInsets=NO; can be set to clear the space.


2022-09-30 20:59

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.