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

112
Views
Cómo hacer que el selector aparezca en la región seleccionada en React Native

Intento implementar un selector y hacerlo visible solo en un área determinada de una caja. Agregué un estilo con ancho y alto a mi selector y esperaba que el selector apareciera en este cuadro. El selector se vuelve completamente diferente. ¿Cómo puedo representar el selector dentro del cuadro que defino en mi atributo de estilo para el selector?

Aquí está mi implementación:

Importaciones

 import React, { useState } from "react"; import { StyleSheet, Text, View } from "react-native"; import { Picker } from "@react-native-picker/picker";

Función

 const LandingPage = () => { const [selectedValue, setSelectedValue] = useState("10 rounds"); return ( <View style={[styles.styleGeneral, {}]}> <View style={[styles.styleStandardOne]}>...Some view...</View> <View style={[styles.styleForPicker]}> <Text style={{ fontSize: 30 }}>Rounds</Text> <Picker selectedValue={selectedValue} style={{ height: 100, width: 100, backgroundColor: "blue" }} onValueChange={(itemValue, itemIndex) => setSelectedValue(itemValue)} > <Picker.Item label="red" value="0"></Picker.Item> <Picker.Item label="blue" value="1"></Picker.Item> </Picker> </View> <View style={[styles.styleStandardTwo]}>...Some view...</View> <View style={[styles.styleStandardTwo]}>...Some view...</View> <View style={[styles.styleStandardTwo]}>...Some view...</View> </View> ); };

Estilos

 const styles = StyleSheet.create({ styleGeneral: { flex: 1, padding: 20, flexDirection: "column", margin: 0, padding: 0, }, styleForPicker: { backgroundColor: "yellow", flex: 3, }, styleStandardOne: { backgroundColor: "red", flex: 1.5, justifyContent: "center", }, styleStandardTwo: { backgroundColor: "red", justifyContent: "center", alignItems: "center", flex: 3, }, });
about 4 years ago · Juan Pablo Isaza
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!