-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgetSysInfo.js
48 lines (39 loc) · 1.03 KB
/
getSysInfo.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
/**
* Sample React Native App
* https://github.com/facebook/react-native
*
* @format
* @flow
*/
import React from 'react';
import {
SafeAreaView,
View,
Text,
StatusBar,
Dimensions,
Platform
} from 'react-native';
const deviceWidth='simple one';
const scaleInfo= "x1 = 显示一个50x50的图,使用的图片就是50x50 \n x3= 显示一个50x50的图,使用的图片就是150x150 (需要的图片分辨率更高)";
const App: () => React$Node = () => {
return (
<>
<StatusBar barStyle="dark-content" />
<SafeAreaView style={{flex:1,justifyContent:"center",alignItems:"center"}}>
<View>
<Text>当前设备的宽度:{Dimensions.get("window").width}</Text>
<Text>当前设备的高度:{Dimensions.get("window").height}</Text>
<Text>当前设备的分辨率:{Dimensions.get("window").scale}</Text>
<Text>
{scaleInfo}
</Text>
<Text>
{Platform.OS} -- {Platform.Version} -- {Platform.isPad}
</Text>
</View>
</SafeAreaView>
</>
);
};
export default App;