Musisz poczytać dokumentacje + obejrzeć jakiś tutorial, który tłumaczy krok po kroku jak to zrobić, bo są to dość podstawowe rzeczy
- Dokumentacja React Native: https://reactnative.dev/docs/components-and-apis
- I jeśli zbudowałeś projekt w oparciu o Expo to także to https://docs.expo.dev/
- Chce ustawić dwie ikony na tej samym poziomie. Jedna ma być po lewej a druga po prawej stronie jak to można zrobić ?
import React from 'react';
import { Image, View, StyleSheet } from 'react-native';
const App = () => (
<View style={styles.container}>
<View style={styles.column}>
<Image style={styles.icon} source={require("./assets/snack-icon.png")} />
</View>
<View style={styles.column}>
<Image style={styles.icon} source={require("./assets/snack-icon.png")} />
</View>
</View>
);
// Tutaj możesz zmienić stylowanie
const styles = StyleSheet.create({
container: {
display: 'flex',
flexDirection: 'row',
justifyContent: 'space-between',
},
column: {
flex: 1,
},
icon: {
width: 30,
height: 30,
},
});
export default App;
- mam obrazek splash I chce aby się dostosowywał do różnych rozdzielczości jak to mogę zrobić ?
Obrazek splash
... nie wiem, czy dobrze rozumiem, ale chcesz go ustawić jako tło aplikacji?
https://reactnative.dev/docs/imagebackground
import React from "react";
import { ImageBackground, StyleSheet, Text, View } from "react-native";
const image = { uri: "https://reactjs.org/logo-og.png" };
const App = () => (
<View style={styles.container}>
<ImageBackground source={image} resizeMode="cover" style={styles.image}>
<Text style={styles.text}>Inside</Text>
</ImageBackground>
</View>
);
const styles = StyleSheet.create({
container: {
flex: 1,
},
image: {
flex: 1,
justifyContent: "center"
},
text: {
color: "white",
fontSize: 42,
lineHeight: 84,
fontWeight: "bold",
textAlign: "center",
backgroundColor: "#000000c0"
}
});
export default App;