- Hands-On Design Patterns with React Native
- Mateusz Grzesiukiewicz
- 119字
- 2021-08-13 15:12:59
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.
推薦閱讀
- C語言程序設計(第2 版)
- Photoshop智能手機APP UI設計之道
- 兩周自制腳本語言
- Learning RabbitMQ
- 信息安全技術
- 精通API架構:設計、運維與演進
- INSTANT Django 1.5 Application Development Starter
- C#應用程序設計教程
- Learning R for Geospatial Analysis
- Go語言精進之路:從新手到高手的編程思想、方法和技巧(2)
- 深入剖析Java虛擬機:源碼剖析與實例詳解(基礎卷)
- Clojure for Machine Learning
- Go語言開發實戰(慕課版)
- 數據分析與挖掘算法:Python實戰
- Keil Cx51 V7.0單片機高級語言編程與μVision2應用實踐