官术网_书友最值得收藏!

The Image component

The next component that you will often use is the Image component. Let's extend our task list with the React logo. After each task, we will show a .png image of the React logo:

// Chapter 2_View patterns/ Example 5/src /Task.js
// ...
<Image
// styles just to make it smaller in the example
style={{width: 100, height: 100}}
source={require("./react.png")}
/>
// ...

Please note that not every image type is supported right now. For instance, SVG images will need a separate library to work.

You can check out the props  that the  Image  component consumes in the official documentation here:  https://facebook.github.io/react-native/docs/image. You will find useful props such as  loadingIndicatorSource  here—this is an image that is shown while a big source image is loading.
主站蜘蛛池模板: 济阳县| 兰西县| 马山县| 四会市| 龙游县| 岑巩县| 望奎县| 永顺县| 息烽县| 东丽区| 湘阴县| 遂宁市| 乌兰察布市| 滕州市| 长武县| 蒙山县| 图们市| 宾阳县| 桂林市| 济阳县| 遂昌县| 博白县| 淮滨县| 长沙县| 罗源县| 武平县| 麻栗坡县| 陆良县| 武陟县| 玉屏| 申扎县| 义马市| 油尖旺区| 华池县| 潍坊市| 陵水| 毕节市| 慈溪市| 高雄市| 青冈县| 绥江县|