-
Notifications
You must be signed in to change notification settings - Fork 0
/
image.js
68 lines (52 loc) · 1.6 KB
/
image.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
/**
* Sample React Native App
* https://github.com/facebook/react-native
*
* @format
* @flow
*/
import React from 'react';
import {
SafeAreaView,
View,
Text,
StatusBar,
StyleSheet,
Image,
ImageBackground
} from 'react-native';
import Son from './sonComponent'
const styles= StyleSheet.create({
})
const abc='simple one';
const App: () => React$Node = () => {
return (
<>
<StatusBar barStyle="dark-content" />
<SafeAreaView style={styles.main}>
<View style ={{width:90,height:89,backgroundColor:"blue"}}>
{/**加载本地图片 */}
<Image
style={{width:200,height:200}}
resizeMode='contain' source={require('./assets/big.jpg')}></Image>
{/**加载网络图片 */}
<Image
style={{width:200,height:200}}
resizeMode='stretch' source={{uri:"https://i0.hdslb.com/bfs/archive/4de86ebf90b044bf9ba2becf042a8977062b3f99.png"}}></Image>
{/**加载base64图片 */}
<Image
style={{width: 66, height: 58}}
source={{uri: 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADMAAAAzCAYAAAA6oTAqAAAAEXRFWHRTb2Z0d2FyZQBwbmdjcnVzaEB1SfMAAABQSURBVGje7dSxCQBACARB+2/ab8BEeQNhFi6WSYzYLYudDQYGBgYGBgYGBgYGBgYGBgZmcvDqYGBgmhivGQYGBgYGBgYGBgYGBgYGBgbmQw+P/eMrC5UTVAAAAABJRU5ErkJggg=='}}
/>
{/**背景 */}
<ImageBackground
style={{width:200,height:200}}
resizeMode='stretch' source={require('./assets/big.jpg')}>
<Text>背景中的文本</Text>
</ImageBackground>
</View>
</SafeAreaView>
</>
);
};
export default App;