Стилізація залежно від платформи
Модуль платформи
import { View, Text, StyleSheet, Platform } from "react-native";
export default function App() {
return (
<View style={styles.container}>
<Text style={styles.text}>Hello</Text>
</View>
);
}
export const styles = StyleSheet.create({
container: {
flex: 1,
backgroundColor: "#fff",
alignItems: "center",
justifyContent: "center",
},
text: {
fontSize: 35,
backgroundColor: Platform.OS === "ios" ? "red" : "yellow",
},
});Спеціальні розширення платформи
Last updated