Ich bin ein kompletter Anfänger und meine buttons stehen leider untereeinander. Ich würde aber gerne, dass jeweils 2 nebeienander stehen. wie erreiche ich das. ich arbeite mir VS und Java. Wenn ich chatgpt frage sagt er mir denbefehl buttonrow. den gibt es aber bei VS nicht.
{/* BUTTONS UNTER DER KARTE */}
<View style={styles.buttonContainer}>
<Text style={styles.title}>Willkommen bei PikUp!</Text>
{/* Erste Reihe mit zwei Buttons */}
<TouchableOpacity style={styles.button} onPress={() => router.push('/suchen')}>
<Text style={styles.buttonText}>🔍 Transport suchen</Text>
</TouchableOpacity>
<TouchableOpacity style={styles.button} onPress={() => router.push('/anbieten')}>
<Text style={styles.buttonText}>🚛 Transport anbieten</Text>
</TouchableOpacity>
<TouchableOpacity style={styles.button} onPress={() => router.push('/chats')}>
<Text style={styles.buttonText}>🚛 Chats</Text>
</TouchableOpacity>
<TouchableOpacity style={styles.button} onPress={() => router.push('/profil')}>
<Text style={styles.buttonText}>🚛 Profil</Text>
</TouchableOpacity>
</View>
</View>
);
}
const styles = StyleSheet.create({
container: {
flex: 1,
},
map: {
width: '100%',
height: Dimensions.get('window').height * 0.6,
},
buttonContainer: {
flex: 1,
justifyContent: 'flex-end',
alignItems: 'center',
backgroundColor: '#1B3A4B',
paddingTop: 10,
paddingBottom: 30,
width: '100%',
},
title: {
fontSize: 30,
fontWeight: 'bold',
marginBottom: 40,
color: '#D1A05D',
},
button: {
width: 250,
paddingVertical: 15,
backgroundColor: '#D1A05D',
borderRadius: 50,
alignItems: 'center',
marginBottom: 15,
},
buttonText: {
fontSize: 18,
color: '#fff',
fontWeight: 'bold',
},
{/* BUTTONS UNTER DER KARTE */}
<View style={styles.buttonContainer}>
<Text style={styles.title}>Willkommen bei PikUp!</Text>
{/* Erste Reihe mit zwei Buttons */}
<TouchableOpacity style={styles.button} onPress={() => router.push('/suchen')}>
<Text style={styles.buttonText}>🔍 Transport suchen</Text>
</TouchableOpacity>
<TouchableOpacity style={styles.button} onPress={() => router.push('/anbieten')}>
<Text style={styles.buttonText}>🚛 Transport anbieten</Text>
</TouchableOpacity>
<TouchableOpacity style={styles.button} onPress={() => router.push('/chats')}>
<Text style={styles.buttonText}>🚛 Chats</Text>
</TouchableOpacity>
<TouchableOpacity style={styles.button} onPress={() => router.push('/profil')}>
<Text style={styles.buttonText}>🚛 Profil</Text>
</TouchableOpacity>
</View>
</View>
);
}
const styles = StyleSheet.create({
container: {
flex: 1,
},
map: {
width: '100%',
height: Dimensions.get('window').height * 0.6,
},
buttonContainer: {
flex: 1,
justifyContent: 'flex-end',
alignItems: 'center',
backgroundColor: '#1B3A4B',
paddingTop: 10,
paddingBottom: 30,
width: '100%',
},
title: {
fontSize: 30,
fontWeight: 'bold',
marginBottom: 40,
color: '#D1A05D',
},
button: {
width: 250,
paddingVertical: 15,
backgroundColor: '#D1A05D',
borderRadius: 50,
alignItems: 'center',
marginBottom: 15,
},
buttonText: {
fontSize: 18,
color: '#fff',
fontWeight: 'bold',
},