Harkirat Saluja
Harkirat Saluja

Reputation: 8114

How to add a check mark to a selected option in Action Sheet IOS option in react native?

I was working on react native app in which I need to change few values in a component after user has selected an option.

To select an option I open action sheet in IOS. Now I wanted to show the current selected option in the Action Sheet by adding a check mark.

I was able to see this in podcast app of iphone as attached in the screenshot.

I was also able to see few native implementations of this in here , but I wanted this to work in case of react native.

Can someone please help?

Upvotes: 1

Views: 1271

Answers (1)

Weidian Huang
Weidian Huang

Reputation: 2935

Easy way to do is to use destructiveButtonIndex property of the Action Sheet. It cannot add a check mark, but at least will change the colour of the option to orange. In this case, user can know which one is checked before.

Upvotes: 1

Related Questions