Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

134
Vistas
Alignment issues with a scratch React Native calendar

I'm building a calendar component scratch but I can't get the days and dates to line up, Here's what I'm getting: enter image description here

The days (SMTWTFS) don't align above the dates, and the last three dates at the bottom have more space in-between them than the other dates.

The best I got was to justify the days with space-around and give a flex of 7 to the parent and 1 to the children, although this didn't fix the issue of having too much space between the items in the last row, and the 5th row was slightly off left from the "T" for some reason. My code is below, if someone could tell me what's wrong with my styling I'd appreciate it!

    <View style={styles.daysView}>
                    <FlatList
                        scrollEnabled={false}
                        ListHeaderComponent={
                            <FlatList
                                horizontal
                                data={days}
                                contentContainerStyle={{}}
                                keyExtractor={(item) => item.id}
                                renderItem={({ item }) => (
                                    <View>
                                        <Text style={styles.dayLabel}>
                                            {item.day[0]}
                                        </Text>
                                    </View>
                                )}
                            />
                        }
                        contentContainerStyle={{
                            flexDirection: "column",
                        }}
                        data={numOfDays}
                        numColumns={7}
                        keyExtractor={(item) => item.id}
                        renderItem={({ item }) => (
                            <View style={{ flex: 1 }}>
                                <TouchableOpacity style={styles.dateTouchable}>
                                    <Text
                                        style={{
                                            textAlign: "center",
                                            fontFamily: "medium",
                                        }}
                                    >
                                        {item.number}
                                    </Text>
                                </TouchableOpacity>
                            </View>
                        )}
                    />
                </View>

const styles = StyleSheet.create({
    daysView: {
        width: "100%",
        marginTop: 5,
        flex: 7,
        flexDirection: "column",
    },
    dayLabel: {
        fontFamily: "semi",
        fontSize: 14,
    },
    dateTouchable: {
        borderRadius: 20,
        backgroundColor: "#DCF1F9",
        width: 30,
        height: 30,
        marginTop: 5,
    },
});
about 4 years ago · Juan Pablo Isaza
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda