facebook / react-native

A framework for building native applications using React
https://reactnative.dev
MIT License
118.16k stars 24.21k forks source link

App not covering fulll device height #46151

Open SrinjoyBarman opened 3 weeks ago

SrinjoyBarman commented 3 weeks ago

Description

Hi,

Screenshot 2024-08-22 at 2 15 13 PM

According to the above image, you can see that its not taking up full height.

Below is my app.tsx

import React from 'react'; import type {PropsWithChildren} from 'react'; import { SafeAreaView, ScrollView, StatusBar, StyleSheet, Text, useColorScheme, View, } from 'react-native';

import {Colors} from 'react-native/Libraries/NewAppScreen';

type SectionProps = PropsWithChildren<{ title: string; }>;

const Section: React.FC = ({children, title}) => { const isDarkMode = useColorScheme() === 'dark'; return (

{title} {children}

); };

const App: React.FC = () => { const isDarkMode = useColorScheme() === 'dark';

return ( <SafeAreaView style={[ styles.safeArea, {backgroundColor: isDarkMode ? Colors.darker : Colors.lighter}, ]}> <StatusBar barStyle={isDarkMode ? 'light-content' : 'dark-content'} backgroundColor={isDarkMode ? Colors.darker : Colors.lighter} /> <ScrollView contentInsetAdjustmentBehavior="automatic" style={{ flex: 1, backgroundColor: isDarkMode ? Colors.black : Colors.white, }}>

Edit App.tsx to change this screen and then come back to see your edits.
    <Section title="See Your Changes">
      {/* Replace with actual instructions or content */}
    </Section>
    <Section title="Debug">
      {/* Replace with actual debug instructions */}
    </Section>
    <Section title="Learn More">
      Read the docs to discover what to do next:
    </Section>
  </ScrollView>
</SafeAreaView>

); };

const styles = StyleSheet.create({ safeArea: { flex: 1, }, sectionContainer: { marginTop: 32, paddingHorizontal: 24, }, sectionTitle: { fontSize: 24, fontWeight: '600', }, sectionDescription: { marginTop: 8, fontSize: 18, fontWeight: '400', }, highlight: { fontWeight: '700', }, });

export default App;

Can you please help me solve the issue?

Steps to reproduce

  1. on app launch

React Native Version

0.75.2

Affected Platforms

Runtime - Android

Output of npx react-native info

System:
  OS: macOS 14.6.1
  CPU: (8) arm64 Apple M1
  Memory: 336.98 MB / 16.00 GB
  Shell:
    version: "5.9"
    path: /bin/zsh
Binaries:
  Node:
    version: 22.1.0
    path: /opt/homebrew/bin/node
  Yarn:
    version: 1.22.22
    path: ~/node_modules/.bin/yarn
  npm:
    version: 10.7.0
    path: /opt/homebrew/bin/npm
  Watchman: Not Found
Managers:
  CocoaPods:
    version: 1.15.2
    path: /.rbenv/shims/pod
SDKs:
  iOS SDK:
    Platforms:
      - DriverKit 23.5
      - iOS 17.5
      - macOS 14.5
      - tvOS 17.5
      - visionOS 1.2
      - watchOS 10.5
  Android SDK: Not Found
IDEs:
  Android Studio: 2022.2 AI-222.4459.24.2221.10121639
  Xcode:
    version: 15.4/15F31d
    path: /usr/bin/xcodebuild
Languages:
  Java:
    version: 17.0.6
    path: /usr/bin/javac
  Ruby:
    version: 2.7.5
    path: /.rbenv/shims/ruby
npmPackages:
  "@react-native-community/cli": Not Found
  react:
    installed: 18.3.1
    wanted: 18.3.1
  react-native:
    installed: 0.75.1
    wanted: 0.75.1
  react-native-macos: Not Found
npmGlobalPackages:
  "*react-native*": Not Found
Android:
  hermesEnabled: true

Stacktrace or Logs

NA

Reproducer

NA

Screenshots and Videos

No response

react-native-bot commented 3 weeks ago
:warning: Newer Version of React Native is Available!
:information_source: You are on a supported minor version, but it looks like there's a newer patch available - 0.75.2. Please upgrade to the highest patch for your minor or latest and verify if the issue persists (alternatively, create a new project and repro the issue in it). If it does not repro, please let us know so we can close out this issue. This helps us ensure we are looking at issues that still exist in the most recent releases.
react-native-bot commented 3 weeks ago
:warning: Missing Reproducible Example
:information_source: We could not detect a reproducible example in your issue report. Please provide either:
  • If your bug is UI related: a Snack
  • If your bug is build/update related: use our Reproducer Template. A reproducer needs to be in a GitHub repository under your username.
react-native-bot commented 3 weeks ago
:warning: Missing Reproducible Example
:information_source: We could not detect a reproducible example in your issue report. Please provide either:
react-native-bot commented 3 weeks ago
:warning: Newer Version of React Native is Available!
:information_source: You are on a supported minor version, but it looks like there's a newer patch available - undefined. Please upgrade to the highest patch for your minor or latest and verify if the issue persists (alternatively, create a new project and repro the issue in it). If it does not repro, please let us know so we can close out this issue. This helps us ensure we are looking at issues that still exist in the most recent releases.
shubhamguptadream11 commented 3 weeks ago

@SrinjoyBarman It will be great if you provide a repro either using Snack or this template.