Noby
Noby

Reputation: 6602

How to create a toggle button with 3 options...?

I want to create a toggle button with 3 options. I don't want to use radio button or check box.

I want to create like this....

toggle button

How to create this...?

Thanks in advance...!

Upvotes: 1

Views: 3406

Answers (1)

Micky
Micky

Reputation: 512

Create the artwork for the left/middle/right buttons and create three separate buttons next to each other in a horizontal linear layout

Then in code get all three references to the buttons. When a button is clicked set a boolean e.g _button1Clicked = true (or use an array?) and set the image to a downstate, check the other buttons, set their images to upstate and reset their booleans to false!

Easy!

Upvotes: 2

Related Questions