RMessage: [Issue] [iPhone X] Notification banner is too short, doesn't extend down far enough to display title.
Hi there!
I just started testing on iPhone X and noticed that the top banner (when no nav bar is present) doesn’t extend down far enough to show the title and description properly.
This is obviously due to the weird new height measurements of iPhone X’s nav bar but I was wondering if this is already a solved issue or if there’s something I should be specifically doing to solve this?
Thanks!
This is the code I’m using:
[RMessage showNotificationWithTitle:@"Important account change"
subtitle:@"You have been logged out due to an important account change."
type:RMessageTypeCustom
customTypeName:mProfileStyleKey
callback:nil];
About this issue
- Original URL
- State: closed
- Created 6 years ago
- Comments: 20 (10 by maintainers)
@sssandyad @harrytutorful Ok. Please test develop and tell me if this issue still exists for you. I believe cf0473f3d6 should do something 😀.
Can you guys tell me what the
safeAreaInsets
property of your view controller’s view is right before calling RMessage to present on it?You can call a line like this to show what I need:
Also when are you calling RMessage to present in your view controller? RMessage depends on the safeAreaInsets property of your view to properly present and decide how big to size itself. But according to the Apple docs the safeAreaInsets property might be 0 (which would cause the issue you are seeing) if your view hasn’t been fully presented when calling RMessage. That may be the reason why this is happening.
@harrytutorful I created simple project (https://github.com/sssandyad/testRMessage) as an example to reproduce the bug. But as @donileo said, It can’t be reproduced.
So I suspected the problem is from our side and it must be related to auto layout stuff and yet I am aware that there are some hacky codes to updating layout view in our project.
I found out that when the navigation bar is hidden, RMessage will be subview of
view
from view controllerwhile the navigation bar is not hidden, RMessage will be subview of
UILayoutContainerView
from navigation controllerIt’s rather hacky but here the solutions I can propose for you:
viewDidLayoutSubview
, get RMessageView from there and set its frame origin y position, orviewDidLayoutSubview
, get RMessageView from there and remove constraints and set it again with the appropriate constraintI also experienced this problem. On iPhone X, when the navigation bar is hidden, the notification banner would not be displayed properly. I tested this on the simulator, and I use version 2.3.1.
This is just on simulator, as I don’t have an X to hand.