Does SafeAreaView support android?
See original GitHub issueI am testing SafeAreaView but this seems not to work on Android.
My app has a minimalistic design and I have hidden the status bar… So, that is why I wrapped most of my components inside your component… The problem is that I have had to write an extra padding for Android like this:
import React from “react”; import { StyleSheet, Platform, StatusBar } from “react-native”; import { SafeAreaView } from “react-native-safe-area-context”;
export default function (props) {
return (
<SafeAreaView style={styles.AndroidSafeArea} {...props}>
{props.children}
</SafeAreaView>
);
}
const styles = StyleSheet.create({
AndroidSafeArea: {
paddingTop: Platform.OS === "android" ? StatusBar.currentHeight : 0,
},
});
Something that doesn’t seems really elegant.
Will this feature be implemented in a future so that I don’t have to use this custom component?
Thank you.
Issue Analytics
- State:
- Created 3 years ago
- Comments:5
Top Results From Across the Web
How to use SafeAreaView for Android notch devices?
The SafeAreaView is a solution for the iPhone X but for Android, it seems there is no solution. How to solve this kind...
Read more >(React native) How to use SafeAreaView for Android notch ...
Android : (React native) How to use SafeAreaView for Android notch devices?
Read more >SafeAreaView for Android devices | Voters - Expo
Hi, SafeAreaView works great for iOS, but there is still many android devices that we are not giving a great support like moto...
Read more >SafeAreaView - React Native
The purpose of SafeAreaView is to render content within the safe area boundaries of a device. It is currently only applicable to iOS...
Read more >How to Use Safe Area Context in React Native Apps to Avoid ...
The SafeAreaView acts like a regular View component from React Native and includes additional padding to position the content below the notch or ......
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
It works on android for sure. Are you sure you haven’t imported SafeAreaView from ‘react-native’ ?
@nickelbob i solved this by follows, you can have a try: