react native - screen cut off at bottom

paoliff

I'm building a React Native app for the first time using an iOS Simulator with XCode, and it seems that my elements on the bottom of the screen are being cut off, as if the screen can only scroll so far. I've tried changing the overall container View's height, but it doesn't change how far down I can scroll. I've also tried removing the styling, as well as changing View to ScrollView, but neither helped. Another strange thing is that I need to add paddingTop, otherwise, the first Text is displayed over the time in the simulator

Here's the code:

import React from 'react';
import { StyleSheet, Text, View } from 'react-native';
import Fields from './components/Fields.js'

export default class App extends React.Component {
  render() {
    return (
      <View style={styles.container}>
        <Text>Calculator</Text>
        <Text>1099 Calculator</Text>
        <Fields />
      </View>
    );
  }
}

const styles = StyleSheet.create({
  container: {
    flex: 1,
    backgroundColor: '#fff',
    alignItems: 'center',
    paddingTop: 50
  },
});

Here's the top of the screen without the padding enter image description here

And here's how it looks cut off enter image description here

ystal

This is an issue I also had. To fix it just wrap your container with another view without padding but with flex. So like this:

export default class App extends React.Component {
  render() {
    return (
      <View style={styles.main}>
        <View style={styles.container}>
          <Text>Calculator</Text>
          <Text>1099 Calculator</Text>
          <Fields />
        </View>
      </View>
    );
  }
}

const styles = StyleSheet.create({
  container: {
    flex: 1,
    backgroundColor: '#fff',
    alignItems: 'center',
    paddingTop: 50
  },
  main: {
   flex: 1   
  }
});

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

Android Textview text cut off at bottom

React-Native text get's vertically cut off for no reason

Android L ActionBarActivity using Feinstein SldingMenu and AppCompat v21 is cut off at bottom of the screen

Part of fragment inside ViewPager getting cut off at bottom of screen(Android)

I want a UITableView inside of a UIScrollView to extend to the bottom of the UIScrollView and not get cut off by initial screen

React Native ScrollView is cut off from the bottom in iOS

React native , text getting cut off when i style image

React Native screen display cut off at top and bottom, and app looks zoomed in

Android - ExpandableListView content cut off at bottom of screen

How to align button at bottom of screen in react native?

Text is getting cut off in android for react native

How to hide bottom navigation bar on a specific screen in react native?

React Native: Cannot vertically align an image to bottom of the screen

React Native Input is off screen

React Native - timer progress with screen off

React Native screen cut off at top Android

React-Native: Screen gets cut in half

How to move react navigation Stack header to bottom of the screen in React native?

How to add screen to custom bottom navigation in react native

How to conditionaly change screen buttons in React Native bottom tab?

UIWebView cut off at the bottom by UITabBarController

Bottom of JScrollPane is cut off

Bottom of Table View (Cell) cut off

airodump-ng info at screen bottom is cut-off

Can't align button to the bottom left of the screen - React Native

React-native header title image is cut off, why?

React Native: Prevent screen from being turned off

text in flatlist going off screen react native

Detect whatever screen off in react native