Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

130
Views
El tamaño del contenido de navegación de React es demasiado estrecho

Hola, estoy implementando la navegación de reacción en una aplicación nativa de reacción y estoy siguiendo los documentos sobre la navegación de reacción. Y yo cuando ejecuto el código este es el resultado: Resultado

Mi pregunta es cómo hago para que el ancho del contenido central sea el mismo que el de la pantalla. Además, es la primera vez que uso react native expo después de cambiar de reactJS

Código: código del navegador:

 import Login from "./Login"; import Signup from "./Signup"; import { createAppContainer, NavigationContainer, NavigationNavigator, } from "react-navigation"; import { createStackNavigator } from "react-navigation-stack"; import Chat from "./Chat"; import Error from "./Error"; /** * This is the screen stack of the navigation stack. */ const screens: any = { default: { screen: Login }, signup: { screen: Signup }, chat: { screen: Chat }, Error: { screen: Error }, }; const stack: NavigationNavigator<any, any> = createStackNavigator(screens); const container: NavigationContainer = createAppContainer(stack); export default container;

Aplicación.tsx:

 import { StatusBar } from "expo-status-bar"; import React from "react"; import { Alert, StyleSheet, Text, View } from "react-native"; import * as expoAppLoading from "expo-app-loading"; import loadFonts from "./assets/fonts/loader"; import Navigator from "./screens/navigator"; /** * This is the main app component of the Chill&chat application. */ const App: React.FC = () => { const [loading, setLoading] = React.useState(true); const style: any = StyleSheet.create({ container: { flex: 1, backgroundColor: "#fff", alignItems: "center", justifyContent: "center", }, text: { fontFamily: "poppinsBold", }, }); if (loading) { return ( <expoAppLoading.default startAsync={async (): Promise<void> => { await loadFonts(); }} onFinish={(): void => { setLoading(false); }} onError={(): void => { Alert.alert("Error", "Error loading fonts"); }} /> ); } else { return ( <View style={style.container}> <Navigator /> <StatusBar style="auto" /> </View> ); } }; export default App;
about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Debería poder establecer el ancho agregando dimensiones porcentuales a su hoja de estilo para el elemento deseado. Sin embargo, esto puede requerir que elimine el diseño flexible o use flex en un padre en su lugar.

 container: { width:'100%', },

Sin embargo, esto debería resolver el problema del ancho.

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!