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

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.
主站蜘蛛池模板: 兴海县| 且末县| 读书| 晋城| 金华市| 汶上县| 临沂市| 桦甸市| 泽库县| 保康县| 丰镇市| 灵寿县| 华容县| 大同市| 渝北区| 海安县| 清徐县| 资兴市| 台东市| 海宁市| 斗六市| 锡林郭勒盟| 舒兰市| 阜新| 泰顺县| 常德市| 云浮市| 宁远县| 舞阳县| 荆州市| 蓬安县| 新平| 墨脱县| 清镇市| 马龙县| 嘉黎县| 台中市| 五峰| 固安县| 财经| 合作市|