1

This problem occurs depending on the language setting of iPhone.
I was able to confirm this problem in Japanese and Chinese.
In English etc. this problem does not occur.

I have created a simple project that installing UINavigationController on the storyboard, using Xcode10. rootViewController is the default UITableViewController.
I have not changed anything nearly anything on the storyboard.
I use an array of Strings 1 to 5 as datasource of UITableView.

If I build and rotate this on iOS12, UITableView will be plus offset top or it will be under NavigationBar.
This problem does not occur in iOS11. Also, no problems will occur in models without notch.
This problem occurs only with notched models of iOS12. (iPhone X, XS, XS Max, Xr)

Does anyone know the cause of this strange problem?
Thank you.

strange plus offset of top

under NavigationBar

I uploaded my project to GitHub. Could you confirm it?

yaslam2222/SimpleTableViewController

yaslam
  • 108
  • 7
  • What is table view’s `contentInsetAdjustmentBehavior`? – matt Oct 01 '18 at 11:43
  • Also please show code. Are you reloading the table view? – matt Oct 01 '18 at 11:45
  • @matt Since contentInsetAdjustmentBehavior has not set a value arbitrarily, it is default automatic. Also, setting this other value to contentInsetAdjustmentBehavior does not fix this problem. I uploaded my project to GitHub. – yaslam Oct 02 '18 at 04:12
  • Thanks for the github project! I can't reproduce any problem with it. – matt Oct 02 '18 at 04:43
  • @matt Thank you for confirmation. In my environment this problem will always be reproduced. Did you rotate the device several times after launching the application? Have you confirmed with models with notch of iOS12? (iPhone X, XS, XS Max, XR) – yaslam Oct 02 '18 at 05:06
  • @matt I found a strange cause!! This problem occurs depending on the language setting of iPhone. I was able to confirm this problem in Japanese and Chinese. In English etc this problem does not occur. Is this a bug in iOS12? – yaslam Oct 02 '18 at 05:23
  • Yes!!!! I can confirm this behavior with Chinese language and system on an iOS 12 iPhone X simulator — but with an iOS 11 iPhone X simulator, there's no problem. You can download the iOS 11 simulator SDK and try it for yourself. – matt Oct 02 '18 at 14:20
  • By the way, to experiment, you don't need to change the Settings on the simulator; just use the pop-up menus in the Scheme (Run -> Options, Application Language and Application Region). – matt Oct 02 '18 at 14:22
  • @matt On the simulator, it was confirmed just by changing the language setting of the scheme. It is very convenient. Thanks. – yaslam Oct 03 '18 at 02:35

2 Answers2

1

I think you've found a bug! (As you have rightly explained, this happens only on an X device, only in iOS 12, and only in a Chinese or Japanese environment.)

Here is a workaround — not very satisfactory, but at least it is a workaround:

override func viewDidLoad() {
    super.viewDidLoad()
    self.edgesForExtendedLayout = []
}
matt
  • 515,959
  • 87
  • 875
  • 1,141
0

I reported this bug to Apple. Apple responded that it shall be fixed on iOS 12.1.
I installed Xcode 10.1 beta 2 and confirmed this bug on iOS 12.1 simulator.
I confirmed that this bug has been fixed on iOS 12.1 (simulator).
Thank you.

enter image description here enter image description here

yaslam
  • 108
  • 7