How can I put an icon inside a TextInput in React Native?

前端 未结 9 2131
轻奢々
轻奢々 2020-12-04 19:03

I am thinking of having something like this https://android-arsenal.com/details/1/3941 where you have icon that you press to show password as plaintext, not as dots. However

9条回答
  •  刺人心
    刺人心 (楼主)
    2020-12-04 19:14

    In case is useful I share what I find a clean solution:

    
       onChange(text)}
        value={value}
      />
      
    
    

    and then in your css

     inputContainer: {
        justifyContent: 'center',
      },
      input: {
        height: 50,
      },
      icon: {
        position: 'absolute',
        right: 10,
      }
    

提交回复
热议问题