react-native-ui-kitten icon indicating copy to clipboard operation
react-native-ui-kitten copied to clipboard

SafeArea in Navigation example does not apply the theme background colour

Open logicman opened this issue 3 years ago • 3 comments

💬 Question

When using the example on https://akveo.github.io/react-native-ui-kitten/docs/guides/configure-navigation#create-screens the background colour of the SafeAreaView does not match that of the theme. Is this an issue?

simulator_screenshot_53598B21-E898-4AAD-B4B9-A677F536FA3D

UI Kitten and Eva version

Package Version
@eva-design/eva ^2.1.1
@ui-kitten/components ^5.1.2

logicman avatar Apr 01 '22 15:04 logicman

Yes, you can't see status bar in dark mode. Icons are white on a white background.

image

sikemullivan avatar Oct 27 '22 00:10 sikemullivan

I switched to using the top nav from react navigation. Then switching the theme for react navigation based on the OS theme.

const { Navigator, Screen } = createNativeStackNavigator();

const HomeNavigator = () => {

  return (
    <Navigator>
      <Screen name="Home" component={HomeScreen} options={{ title: "Home" }} />
      <Screen name="RaceNew" component={RaceNewScreen} options={{ title: "New Race" }} />
    </Navigator>
  )
};

export const AppNavigator = () => {
  const theme = useColorScheme() === 'light' ? DefaultTheme : DarkTheme;

  return (
    <NavigationContainer theme={theme}>
      <HomeNavigator />
    </NavigationContainer>
  )
};

export default function App() {
  const colorScheme = useColorScheme() ?? 'dark';

  return (
    <>
      <IconRegistry icons={EvaIconsPack} />
      <ApplicationProvider {...eva} theme={eva[colorScheme]}>
        <AppNavigator/>
      </ApplicationProvider>
    </>
  );
};

image

sikemullivan avatar Oct 27 '22 14:10 sikemullivan

@logicman if I understood the issue correctly, there is no problem in any sort of functionality . SafeAreaView is a container which applies additional paddings which correspond to system elements sizes. SafeAreaView is actually not part of UI Kitten library, so to make it match some color from the theme you should manually set desired color via styles. I think the aim of that example was to show how to use components from screen structure perspective.

greenfrvr avatar Oct 31 '22 14:10 greenfrvr