F. Pullem
F. Pullem

Reputation: 39

React Native, how to change styles of button onPress and leave the style

How can i achieve a behaviour like this on the ios tasks app. ios tasks app

where you can select one color, and it stays selected, showing that with a grey border.

Thank you for your answers! Im a noob,

Upvotes: 0

Views: 228

Answers (1)

Or Azoulay
Or Azoulay

Reputation: 219

you can do component to btn with state. const [isClicked,setIsClicked] = useState();

<Button onPress ={()=>setIsClicked(!isClicked)} style={{borderWidth:isClicked?1:0, borderColor:'grey' }}/>

something like that

Upvotes: 1

Related Questions