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

For fixing issue #160 iOs banner overlapping content on iPhone #249

Conversation

looklookson
Copy link
Contributor

Fixing #160

iOs banner overlapping content on iPhone with rounded corners
iPhones with rounded corners appeared 12 sept of 2018
Since that release date iOs "view" gives a "safeAreaLayoutGuide"

Comment on lines 94 to 97
if let window = UIApplication.shared.keyWindow {
let safeAreaBottom = window.safeAreaInsets.bottom
height = height + safeAreaBottom
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you please do not change outside context inside the curly braces?

You can do it with something like

let safeAreaBottom = UIApplication.shared.keyWindow?.safeAreaInsets.bottom ?? 0
height += safeAreaBottom

@distante
Copy link
Contributor

Also please rebase

@looklookson looklookson requested a review from distante August 23, 2023 16:18
@distante distante merged commit f539d3c into capacitor-community:master Aug 23, 2023
@looklookson looklookson deleted the fix-issue-160-ios-banner-overlapping branch October 30, 2023 02:11
@mouadhbb
Copy link
Contributor

mouadhbb commented Jan 19, 2024

Hello @looklookson @distante,

I think we need to do a rollback for this pull request ( My PR #308 ) because it causes problems when we are on a Banner with a TOP_CENTER position, and it also distorts the Banner's height. I believe we should guide developers towards using a plugin like https://github.com/AlwaysLoveme/capacitor-plugin-safe-area to handle such issues in their JavaScript code rather than coding it natively. Here is also an image showing that it causes problems on iOS and, moreover, I no longer have the same behavior between Android and iOS, which is a bit bothersome.
bug image file

@looklookson
Copy link
Contributor Author

Hello @looklookson @distante,

I think we need to do a rollback for this pull request ( My PR #308 ) because it causes problems when we are on a Banner with a TOP_CENTER position, and it also distorts the Banner's height. I believe we should guide developers towards using a plugin like https://github.com/AlwaysLoveme/capacitor-plugin-safe-area to handle such issues in their JavaScript code rather than coding it natively. Here is also an image showing that it causes problems on iOS and, moreover, I no longer have the same behavior between Android and iOS, which is a bit bothersome. bug image file

I don't suggest to rollback this fix because some user currently use this feature. I suggest to add a option to allow user to disable this feature just in case they don't need it.

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

Successfully merging this pull request may close these issues.

None yet

3 participants