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

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.
主站蜘蛛池模板: 司法| 湘潭市| 合山市| 孟津县| 甘德县| 安达市| 周口市| 大连市| 甘德县| 阳信县| 天柱县| 喀什市| 秀山| 仪征市| 哈密市| 含山县| 荣昌县| 集安市| 大城县| 棋牌| 定边县| 大埔区| 晋江市| 赤水市| 象州县| 南康市| 多伦县| 益阳市| 永胜县| 保定市| 龙里县| 肃南| 石楼县| 铜陵市| 绥化市| 大同县| 峡江县| 兰溪市| 桐柏县| 绵竹市| 延川县|