Open tomasbek opened 6 years ago
Why not reduce the height of the message?
The size is fine for all models except for X. I guess that the message is 'higher' on the X due to the notch. Please take a look at the image below: Is it possible to remove that empty space between the bottom of the notch and the top of the text?
SwiftMessages layouts don't put content in safe areas. You can adjust messageView.layoutMarginAdditions.top
on a per-device basis if the default layout don't work for you.
@wtmoose, thank you very much for your suggestion. I have added this line of the code to solve the problem for the iPhone X:
messageView.layoutMarginAdditions.top = -15
For all the other models I set the top margin to 0.
Thanks again for your guidance!
Glad it worked.
In SwiftMessages 4, the layout you're using (it looks like .statusLine
) did not cover the navigation bar. However, I made a global change in SwiftMessages 5 to keep content out of the safe area based on feedback from one of my designers. But after thinking about it more, this layout seems like a good case to break that rule and allow the label into the safe area. So I may revert back to the old behavior in a future update. I'll keep this ticket open for now.
Hi Everybody, I solved the problem 👍 When you add the extension you can solve the problem: The extension function solved when you open in any view controller. The code will open with the view controller prefersStatusBarHidden.
import SwiftMessages
extension WindowViewController {
open override var prefersStatusBarHidden: Bool {
return UIApplication.shared.topMostViewController()?.prefersStatusBarHidden ?? false
}
}
Hi, I have the same issue. I used what you adviced:
SwiftMessages layouts don't put content in safe areas. You can adjust
messageView.layoutMarginAdditions.top
on a per-device basis if the default layout don't work for you.
That works fine but now my issue is that it's hard to tap on it to trigger the buttonTapHandler
.
Any solution ?
Hello,
I need to show a message over the status bar. However, the message covers navigation button on the iPhone X as you can see in this screenshot: The configuration I use is as follows:
What could be done to avoid this problem?
Thank you very much!