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

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.
主站蜘蛛池模板: 黔江区| 延寿县| 陕西省| 河津市| 绥芬河市| 龙海市| 岳普湖县| 桐梓县| 五常市| 望谟县| 乾安县| 海南省| 峨眉山市| 当涂县| 乐陵市| 邯郸市| 浦东新区| 易门县| 门头沟区| 三明市| 抚州市| 施甸县| 余庆县| 三原县| 巩留县| 河北省| 手游| 阿拉善左旗| 监利县| 永清县| 基隆市| 合阳县| 绥阳县| 十堰市| 来凤县| 巨鹿县| 玛纳斯县| 安岳县| 揭西县| 黄陵县| 修水县|