title: Type error:undefined is not an object(evaluating 'style.width')
body: <p>I want to put a car image over a background image, thats all.</p>
  
  <pre><code>import React, { Component } from 'react';
  import {
  ...
    Animated,
    ImageBackground
  } from 'react-native';
  
  
  export default class App extends Component {
    render() {
      return (
        &lt;ImageBackground imageStyle={styles.container} source={require('./src/assets/img/road1.jpg')}&gt;
         &lt;Animated.Image style={styles.car} source={require('./src/assets/img/car2.png')}&gt;
         &lt;/Animated.Image&gt;
        &lt;/ImageBackground&gt;
      );
    }
  }
  
  const styles = StyleSheet.create({
    container: {
      flex: 1,
      position: 'relative',
      resizeMode: 'cover'
    },
    car:{
      position:'absolute',
      width:100,
      height:50
    }
  });
  </code></pre>
  
  <p>When I run this code here is the error screen;
  <a href="https://i.stack.imgur.com/r6lR7.png" rel="noreferrer"><img src="https://i.stack.imgur.com/r6lR7.png" alt="enter image description here"></a>
  actually message is clear;</p>
  
  <pre><code>Type error:undefined is not an object(evaluating 'style.width')
  </code></pre>
  
  <p>ok but why it needs 'style.width' even I used <strong>resizeMode:'cover'</strong> 
  I also set width and heigth attributes in style object still same error.. how can I fix this? </p>