Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Not able to see text in IOS and Android. (React Native)

Not able to see text in IOS and Android. (React Native)

Hi

I was making an app and added text on HomeScreen. I am getting the text in Web but am not able to get it in Android and IOS. This is the Code:

render(){
let pulse = <Image source={require('../pulse.png')} style={styles.pulse} />
    
      return (
        <SafeAreaView style={styles.container}>
        <View>
          <StatusBar barStyle="dark-content" />

          <View style={{ flex: 0.4, resizeMode: 'contain' }}>
            <Text style={styles.appName}>L{pulse}blood</Text>
          </View>

        </View>
        </SafeAreaView>
}

These are the styles

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

  container: {
    flex: 1,
    backgroundColor: 'white',
  },
  appName: {
    alignSelf: 'center',
    fontFamily: 'oswald',
    fontSize: 50,
    color: 'black',
    height: '100%'
  }

>Solution :

You need to remove the flex prop of the child view. Change

<View style={{ flex: 0.4, resizeMode: 'contain' }}>
   <Text style={styles.appName}>L{pulse}blood</Text>
</View>

to

<View style={{ resizeMode: 'contain' }}>
   <Text style={styles.appName}>L{pulse}blood</Text>
</View>
Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading