current position:Home>Reactnative foundation - 03 (image)

Reactnative foundation - 03 (image)

2022-01-27 03:26:37 The black cat made a strange mistake

1、 Remote picture usage : Remote pictures , After default import , Width and height are 0, Width and height should be set

2、 Local pictures ,require grammar , But you don't need to add .default suffix

        blurRadius: Blurred picture , Values are numbers

<Image  source={
   {uri: 'http://www…..png'}}  style={
   {height: 180}} />
<Image source={require('./assets/1.jpg')} style={
   {width: 400, height: 200}}/>
 {/*  Fuzzy  */}
<Image
    source={require('./assets/1.jpg')}
    style={
   {width: 400, height: 200}}
    blurRadius={10}
/>

If the local image is introduced through traversal , You need to write this in the array :

  data = [    
    { title: ' Commodity management ', icon: require('../assets/menu_product.jpg')},
    { title: ' User management ',icon: require('../assets/menu_user.jpg')},
    { title: ' Order management ',icon: require('../assets/menu_order.jpg')},
    { title: ' Homepage management ',icon: require('../assets/menu_refresh.jpg')},
  ];

copyright notice
author[The black cat made a strange mistake],Please bring the original link to reprint, thank you.
https://en.cdmana.com/2022/01/202201270326331983.html

Random recommended