Android Toggle Button / Segmented Button

Possible duplicate:
How to create a toggle button similar to the Twitter app’s toggle button?

I am looking to create a Toggle button, as in the screen below.

enter image description here

If you click one of them to be highlighted, and when someone clicks on the circuit, it will be highlighted.

+4
source share
3 answers

One way is to have a group of views with two buttons. Initially, both buttons are available for viewing. when button 1 is pressed, you can disable it and enable Button2 and vice versa.

The on / off button will display the status. This gives the feel of a segmented control widget.

+2
source

How about using two different graphic elements for a button? One with a highlighted left and one with a highlighted right?

So basically this is just one button having two graphics ...

+1
source

Source: https://habr.com/ru/post/1396805/


All Articles