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

221
Vistas
React Native: el contenido de fondo de la imagen pasó de la pantalla

Estoy agregando un fondo de imagen a mi aplicación, pero la parte horizontal de la imagen pasó la pantalla (las partes derecha e izquierda se cortaron). Intenté usar resizeMode cover y container, pero ninguno de los dos hizo nada. ¿Hay alguna otra forma de hacer que la imagen permanezca dentro de la pantalla? (Uso resizeMode en Image y contiene la imagen normalmente {misma imagen}).

 import React from 'react'; import { Image, ImageBackground, StyleSheet, Text, TouchableOpacity, View, } from 'react-native'; import {DCTBACKGROUND} from '../../../assets/images'; export default function GetStarted({navigation}) { return ( <ImageBackground source={DCTBACKGROUND} style={styles.page}> <View style={styles.buttonContainer}> <TouchableOpacity style={styles.button} onPress={() => { navigation.navigate('Register'); }}> <Text style={styles.buttonText}>Registrasi</Text> </TouchableOpacity> <TouchableOpacity style={styles.button} onPress={() => { navigation.navigate('Login'); }}> <Text style={styles.buttonText}>Login</Text> </TouchableOpacity> </View> </ImageBackground> ); } const styles = StyleSheet.create({ page: { backgroundColor: '#90CC8B', flex: 1, paddingHorizontal: 15, paddingVertical: 25, // resizeMode: 'contain', }, button: { backgroundColor: 'yellow', width: 100, height: 40, alignItems: 'center', justifyContent: 'center', borderWidth: 1, }, buttonText: { color: 'black', }, buttonContainer: { justifyContent: 'space-between', flexDirection: 'row', }, logo: { alignItems: 'center', justifyContent: 'center', flex: 1, }, });

La parte horizontal de la imagen se cortó un poco y necesito que se muestre todo sin cortar. La imagen horizontal se cortó.

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

Agregue resizeMode como accesorio directo a ImageBackground y no como parte de StyleSheet.

 <ImageBackground resizeMode="contain" source={DCTBACKGROUND} style={styles.page}>
about 4 years ago · Juan Pablo Isaza Denunciar
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