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

222
Views
Agregar un ícono de ojo en el lado derecho del campo de entrada en reaccionar nativo

Estoy trabajando en un proyecto nativo de reacción. Tengo un campo de contraseña en la página de inicio de sesión y quiero agregar un icono de ojo en el extremo derecho del campo de entrada. Mi código actualmente se ve así:

 <View><TextInput placeholder='Enter your Password' autoCorrect={false} secureTextEntry={true} textContentType='password'></TextInput></View>

Este es un campo de entrada normal con un texto de marcador de posición.

about 4 years ago · Juan Pablo Isaza
2 answers
Answer question

0

Encuentre el siguiente código:

 const [password, setPassword] = useState(''); const [isPasswordSecure, setIsPasswordSecure] = useState(true); <View style={styles.viewPassword}> <TextInput secureTextEntry={isPasswordSecure} style={styles.textInputStyle} right={ <TextInput.Icon name={() => <MaterialCommunityIcons name={isPasswordSecure ? "eye-off" : "eye"} size={28} color={COLORS.black} />} // where <Icon /> is any component from vector-icons or anything else onPress={() => { isPasswordSecure ? setIsPasswordSecure(false) : setIsPasswordSecure(true) }} /> } fontFamily={FONTS.ROBOTO_REGULAR} fontSize={Theme.FONT_18PX} selectionColor={COLORS.orange} underlineColor={COLORS.orange} label={StringsConstants.Password} value={password} onChangeText={text => setPassword(text)} underlineColorAndroid="transparent" theme={{ colors: { text: COLORS.black, primary: COLORS.orange, placeholder: COLORS.black } }} /> </View>

¡Espero que te ayude!

about 4 years ago · Juan Pablo Isaza Report

0

puedes ponerlo y darle estilo así

 <View> <TextInput placeholder='Enter your Password' autoCorrect={false} secureTextEntry={true} textContentType='password' /> <EyeIconOrImage style={{ position: 'absolute', right: 20, }} /> </View>
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!