slackhq/SlackTextViewController

iOS 11 offset in tableView

josepbordesjove opened this issue · 11 comments

  • I've read and understood the Contributing guidelines and have done my best effort to follow them.
  • I've read and agree to the Code of Conduct.
  • I've searched for any related issues and avoided creating a duplicate issue.

Description

With the brand new iOS 11, there appears an offset on the table view of the SlackTextViewController.

Reproducible in:

  • This is reproducible in the sample project.
    SlackTextViewController version: 1.9.5
    iOS version(s): iOS 11
    Device(s): Anyone (I attach an screen shot of iPhone 7 Plus)

Steps to reproduce:

  1. Download the sample project.
  2. Run it with the iOS 11 simulator and iOS 10.3 simulator (using Xcode 9)

Expected result:

The table should appear without any content offset (iPhone 7 Plus, iOS 10.3.1)

iPhone 7 Plus iOS 10.3.1

Actual result:

The table has offset (iPhone 7 Plus, iOS 11)

iPhone 7 Plus iOS 11

Thank you for your help!

Josep

I imagine this is because of the change in iOS 11 where it no longer automatically adjusts the scroll view's content inset to accommodate top/bottom bars, by default.

Thank you, that solved my problem! For others trying to solve the same issue, I found the solution on the wwdc video, https://developer.apple.com/videos/play/wwdc2017/204/.

 if #available(iOS 11.0, *) {
    tableView.contentInsetAdjustmentBehavior = .never
}

It seems like a better fix is automaticallyAdjustsScrollViewInsets = false which is backwards compatible, being discussed in #531

@josepbordesjove mind try that up, and maybe push a PR fixing it for both, iOS 11 and iOS 10?

@dzenbot, thank you, I am gooing to do that and make a PR!

@josepbordesjove's solution above works. Using automaticallyAdjustsScrollViewInsets = false as @dzenbot suggests does not work for me.

does not work for me either

@yarodevuci it should be solved because the PR is already merged, if not, maybe your problem is different, anyways try to upload your pods.

@josepbordesjove in version: 1.9.6?

@josepbordesjove I am updated, but I still have the issue, any ideas what else to check?

@yarodevuci Can you upload a screenshot of the issue? But I'd copy the code into the viewDidLoad, if the new release does not solve your problems. Also I'd try to delete the Pods and Podfile.lock and install them again.