按设计稿修改,中英文,ios图标问题,statusbar等
This commit is contained in:
1 parent
b6e6905d05
commit
5462cf5abe
37 files changed
+1641
-975
No files matched your search
+27
-20
@@ -1,33 +1,36 @@
|
||||
import React from "react";
|
||||
import { View, Text, TouchableOpacity, StyleSheet, StatusBar } from "react-native";
|
||||
import { NativeStackScreenProps } from "@react-navigation/native-stack";
|
||||
import { View, Text, TouchableOpacity, StyleSheet, StatusBar, Image } from "react-native";
|
||||
import { NativeStackScreenProps,NativeStackNavigationProp } from "@react-navigation/native-stack";
|
||||
import { RootStackParamList } from "../App";
|
||||
import MyStatusbar from "./component/MyStatusbar";
|
||||
import MyHeader from "./component/MyHeader";
|
||||
import pxToDp from "./helper/pxToDp";
|
||||
import DeviceInfo from "react-native-device-info";
|
||||
import { useTranslation } from 'react-i18next';
|
||||
|
||||
type Props = NativeStackScreenProps<RootStackParamList, "Home">;
|
||||
type Props = NativeStackScreenProps<RootStackParamList>;
|
||||
|
||||
export default function HomeScreen({ navigation }: Props) {
|
||||
const { t } = useTranslation();
|
||||
return (
|
||||
<View style={styles.container}>
|
||||
{/* 设置状态栏颜色 */}
|
||||
<StatusBar backgroundColor="#E7141E" barStyle="light-content" />
|
||||
|
||||
<MyStatusbar backgroundColor="#E7141E" dark={false}></MyStatusbar>
|
||||
<MyHeader title={t('home.title')} textColor="#fff" backgroundColor="#E7141E" hideBack navigation={navigation}
|
||||
rightView={<TouchableOpacity style={{width:pxToDp(56),height:pxToDp(56),alignItems:'center',justifyContent:'center'}}
|
||||
onPress={() => navigation.navigate("Setting")}>
|
||||
<Image source={require('./img/Settings.png')} style={{width:pxToDp(48),height:pxToDp(44)}}></Image>
|
||||
</TouchableOpacity>}></MyHeader>
|
||||
{/* 中间按钮 */}
|
||||
<View style={styles.centerBox}>
|
||||
<Image source={require("./img/Search.png")} style={{width:pxToDp(568),height:pxToDp(344),marginBottom:pxToDp(100)}}></Image>
|
||||
<TouchableOpacity
|
||||
style={styles.button}
|
||||
onPress={() => navigation.navigate("Scan")}
|
||||
>
|
||||
<Text style={styles.buttonText}>搜索设备</Text>
|
||||
<Text style={styles.buttonText}>{t('home.scan')}</Text>
|
||||
</TouchableOpacity>
|
||||
</View>
|
||||
|
||||
{/* 底部区域 */}
|
||||
<View style={styles.bottomBox}>
|
||||
<TouchableOpacity onPress={() => navigation.navigate("Privacy")}>
|
||||
<Text style={styles.privacyText}>隐私协议</Text>
|
||||
</TouchableOpacity>
|
||||
<Text style={styles.version}>版本号 v0.0.1</Text>
|
||||
</View>
|
||||
</View>
|
||||
);
|
||||
}
|
||||
@@ -39,18 +42,22 @@ const styles = StyleSheet.create({
|
||||
},
|
||||
centerBox: {
|
||||
flex: 1,
|
||||
justifyContent: "center",
|
||||
// justifyContent: "center",
|
||||
alignItems: "center",
|
||||
backgroundColor:'#fff',
|
||||
paddingTop:pxToDp(250)
|
||||
},
|
||||
button: {
|
||||
backgroundColor: "#E7141E", // 红色按钮
|
||||
paddingVertical: 15,
|
||||
paddingHorizontal: 40,
|
||||
borderRadius: 10,
|
||||
backgroundColor: "#E7141E",
|
||||
borderRadius: pxToDp(24),
|
||||
width:pxToDp(300),
|
||||
height:pxToDp(96),
|
||||
alignItems:'center',
|
||||
justifyContent:'center'
|
||||
},
|
||||
buttonText: {
|
||||
color: "#fff",
|
||||
fontSize: 18,
|
||||
fontSize: pxToDp(32),
|
||||
fontWeight: "bold",
|
||||
},
|
||||
bottomBox: {
|
||||
|
||||
Reference in new issue
Block a user