- 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.
推薦閱讀
- Cocos2D-X權威指南(第2版)
- 程序設計與實踐(VB.NET)
- Arduino by Example
- PHP程序設計(慕課版)
- Java技術手冊(原書第7版)
- NativeScript for Angular Mobile Development
- Building Mobile Applications Using Kendo UI Mobile and ASP.NET Web API
- Python程序設計案例教程
- Mastering RStudio:Develop,Communicate,and Collaborate with R
- 用戶體驗增長:數字化·智能化·綠色化
- Integrating Facebook iOS SDK with Your Application
- Zabbix Performance Tuning
- Python商務數據分析(微課版)
- Java Web從入門到精通(第2版)
- Photoshop CC移動UI設計案例教程(全彩慕課版·第2版)