Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Display issues in UITableViewController on iOS 10 #53

Closed
svenniemann opened this issue Oct 19, 2018 · 14 comments
Closed

Display issues in UITableViewController on iOS 10 #53

svenniemann opened this issue Oct 19, 2018 · 14 comments

Comments

@svenniemann
Copy link

Notifications are display below the Navigation Bar with empty space on top (that space should be behind the navigation bar I guess)

I use the Objective C version. So far this issue only appeared on iOS 10 in an UITableViewController. In UIViewController it works fine.

@isadon
Copy link
Owner

isadon commented Oct 19, 2018

Can you please post a screenshot?

@svenniemann
Copy link
Author

sure!

simulator screen shot - iphone 7 - 2018-10-19 at 10 33 23

@isadon
Copy link
Owner

isadon commented Oct 19, 2018

Does this happen on a blank slate project with a simple table view controller?

@svenniemann
Copy link
Author

I will check this asap. So, you could not reproduce it I guess?

@isadon
Copy link
Owner

isadon commented Oct 20, 2018

To be honest I haven’t had time yet to check. But considering you are reporting this, shouldn’t be hard for you to do 🙂.

@svenniemann
Copy link
Author

Just test it in a new clean project with just a tableviewcontroller in a navigation controller. Same result:

iOS 11 + 12 work fine

simulator screen shot - iphone 7 - 2018-10-21 at 14 09 02

@isadon
Copy link
Owner

isadon commented Oct 23, 2018

I looked into this and will post a fix soon but I honestly believe this is an iOS bug.

RMessage uses the layoutGuide properties of its superview for sizing its height. By default tableViews have the property automaticallyAdjustsScrollViewInsets set to true which tells any container views such as nav controllers to inset the tableview to start below the nav bar.

The issue though is that the Navbar offsets the top layout guide of the the tableview downward by the size of the nav bar (64pts). So now the top of the top layout guide is at the bottom of the nav bar and the bottom of the top layout guide is 64pt below. RMessage uses the bottom of the top layout guide for sizing/spacing. Given that its in a place where its not expected (64pts below the nav) thats why it looks bigger as in your screenshot.

@svenniemann
Copy link
Author

Thanks for analysing the issue! I decided to use a different library (which also adds the banners to the UIWindow, so they always stay on screen). So you don't need to provide a fix just for me.
Would have used your new Swift version, but I need iOS 10 support.

@isadon
Copy link
Owner

isadon commented Oct 23, 2018

Yea I’m looking into making sure the messages stay on the screen as well. Whats interesting is some people (maybe not a lot) may want the message to get pinned to the view as it does now as animations look different that way.

The fix for this issue and “presenting on top” will be added soon. Thanks for reporting 👍.

Update 10.23.2018.17.20.50 : Ok.. It seems that the issue with RMessage not staying on top of the tableview is limited to before iOS 11 as well. On iOS 11 and up the tableView scrolls independently of RMessage.

By the way.. Alternatively try displaying RMessage like this from the UITableViewController:

[RMessage showNotificationInViewController:self.parentViewController title:@"Test" subtitle:nil type:RMessageTypeCustom customTypeName:@"error" callback:nil];

and RMessage will display on top of the UITableViewController. Then you can scroll the tableView and RMessage will stay on top. By default this isn't necessary but due to this issue with iOS 10 it's a workaround.

isadon pushed a commit that referenced this issue Oct 23, 2018
Issue: UITableViewControllers in iOS versions below 11 offset the entire
topLayoutGuide downward when the automaticallyAdjustsScrollViewInsets property
is set (which it is by default). This causes the topLayoutGuide bottom which
normally is located at the bottom of any top bars to now be offset
(height of top bar) pts below the bottom of the bar. This is not expected
behavior (most likely a bug) and causes RMessage to improperly size itself.

This commit fixes the said issue by detecting the presence of the
automaticallyAdjustsScrollViewInsets being set to true, iOS 10 running,
and RMessage's superview being a scrollview.

#53
@isadon
Copy link
Owner

isadon commented Oct 23, 2018

Bugfix added to 2.x.x_develop branch. Please retest.

@svenniemann
Copy link
Author

I will test it tonight.

With "... so they always stay on screen" I meant that they stay on screen when pushing or popping to another ViewController

@isadon
Copy link
Owner

isadon commented Oct 24, 2018

Cool. If RMessage is not picking the right view controllers view to add itself to use showNotificationInViewController:, you should be able to get it to stay behind.

@isadon
Copy link
Owner

isadon commented Nov 2, 2018

@svenniemann any update?

@isadon
Copy link
Owner

isadon commented Nov 17, 2018

Closing Issue..

@isadon isadon closed this as completed Nov 17, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants