You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on May 1, 2024. It is now read-only.
Oftentimes when applying a SafeAreaEffect, it is desireable to maintain the same background color used with a view that would otherwise touch the bottom of the screen viewport. A simple example would be a static footer element on a scrolling page that contains some text, buttons, or other views that shouldn't overlap with unsafe areas on certain iOS devices. If the background color of the footer does not match the background color of the page, the margin created by the SafeAreaEffect would create a change in color between the bottom of the footer and the safe area margin.
Here's a screenshot of this example: Screenshot. The footer bears a light gray, while the page itself bears a white background color. It would be desireable to maintain the light gray footer color through the safe area up to the bottom of the phone screen, maintaining a consistent appearance between iOS and Android as well as iOS devices that don't have a bottom safe area.
It would be very useful in my experience to be able to specify if the SafeAreaEffect should affect the Margin or Padding properties, where the Padding property would extend the height of the view and maintain its background attribute(s).
I understand not all views support Padding while all views support Margin, so I'm not yet sure what the best approach to mitigating scenarios where users attempt to use a Padding-targeted SafeAreaEffect on a view that doesn't support Padding.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Oftentimes when applying a SafeAreaEffect, it is desireable to maintain the same background color used with a view that would otherwise touch the bottom of the screen viewport. A simple example would be a static footer element on a scrolling page that contains some text, buttons, or other views that shouldn't overlap with unsafe areas on certain iOS devices. If the background color of the footer does not match the background color of the page, the margin created by the SafeAreaEffect would create a change in color between the bottom of the footer and the safe area margin.
Here's a screenshot of this example: Screenshot. The footer bears a light gray, while the page itself bears a white background color. It would be desireable to maintain the light gray footer color through the safe area up to the bottom of the phone screen, maintaining a consistent appearance between iOS and Android as well as iOS devices that don't have a bottom safe area.
It would be very useful in my experience to be able to specify if the SafeAreaEffect should affect the Margin or Padding properties, where the Padding property would extend the height of the view and maintain its background attribute(s).
I understand not all views support Padding while all views support Margin, so I'm not yet sure what the best approach to mitigating scenarios where users attempt to use a Padding-targeted SafeAreaEffect on a view that doesn't support Padding.
Beta Was this translation helpful? Give feedback.
All reactions