Me gustaría agregar una banda gris en medio de mi fondo blanco. Aquí está el problema: no puedo escribir nada dentro de él. Aquí está mi código: container: { flex: 1, justifyContent: "center", marginTop: 12, flexDirection: "column", }, upperContainer: { flex: 1, backgroundColor: "#fff", }, lowerContainer: { flex: 1, top: 1400, backgroundColor: "#F7F7F7", }
<ScrollView style={{ flex: 1 }} contentContainerStyle={{ flexGrow: 1 }}> <View style={styles.container}> <View style={styles.upperContainer}> ... <View style={styles.lowerContainer}> ...No estoy seguro de lo que busca con ScrollView, pero aquí hay una forma de hacerlo en un fondo estático:
<View style={{ flex: 1, backgroundColor: '#fff', justifyContent: 'center' }}> <View style={{ backgroundColor: '#bbb', width: '100%', paddingVertical: 12 }}> <Text style={{ textAlign: 'center' }}> Gray Stripe Text </Text> </View> </View >Las claves son:
Probablemente también podría hacer el fondo gris sin la Vista interna, agregando color de fondo directamente al Texto.