Questions tagged [togglebutton]

A GUI control used for selecting 1 of 2 states.

A toggle button is a GUI control that is used for selecting 1 of 2 states, usually "on" or "off". A real-world comparison is a light-switch. Toggle buttons are available in many GUI APIs:

1219 questions
225
votes
27 answers

Change "on" color of a Switch

I'm using a standard Switch control with the holo.light theme in a ICS app. I want to change the highlighted or on state color of the Toggle Button from the standard light blue to green. This should be easy, but I can't seem to work out how to do…
JamesSugrue
  • 14,891
  • 10
  • 61
  • 93
104
votes
3 answers

Toggle button using two image on different state

I need to make a toggle button using two image instead of ON/OFF state. At off state i set a background image.But the OFF text can not removed while i use background image. And i can not set another image on ON state by clicking the toggle button…
MBMJ
  • 5,323
  • 8
  • 32
  • 51
100
votes
1 answer

Android: Specify two different images for togglebutton using XML

I'm attempting to override the default ToggleButton appearance. Here's the XML that defines the ToggleButton:
I82Much
  • 26,901
  • 13
  • 88
  • 119
88
votes
6 answers

Change the On/Off text of a toggle button Android

I just changed the background of a ToggleButton, and now I'm looking to change the ON/OFF text that comes up with it. What is the easiest way to do this?
Tyler
  • 19,113
  • 19
  • 94
  • 151
76
votes
4 answers

Android: Create a toggle button with image and no text

is it possible to create a toggle button in Android that has an image but no text? Ideally it would look like this: Ive seen similar posts where the answer was to change the background but i want to preserve the Holo Light layout and just swap the…
Eduardo
  • 6,900
  • 17
  • 77
  • 121
75
votes
9 answers

How to make a radio button look like a toggle button

I want a group of radio buttons to look like a group of toggle buttons (but still function like radio buttons). It's not necessary that they look exactly like toggle buttons. How can I do this only with CSS and HTML? EDIT: I will be satisfied making…
Pomber
  • 1,165
  • 2
  • 9
  • 13
60
votes
4 answers

Android toggle button custom look

I've been trying to customize the toggle button look but with no success. Here is how I want it to look like: Can someone give me a tutorial?
Mihai Bratulescu
  • 1,915
  • 3
  • 27
  • 43
39
votes
9 answers

attach onClickListener to ToggleButton

I have a ToggleButton and I need to set up simple click actions. How do I implement a simple click listener for a ToggleButton? If you need details please ask.
nkcmr
  • 10,690
  • 25
  • 63
  • 84
35
votes
11 answers

Can't Toggle Navbar in Bootstrap 4 in Angular

Why i can't toggle navbar when resizing to mobile screen in angular 4 using bootstrap 4. I included it in the angular cli in script and styles, the node modules from bootstrap. Is there something missing in my code? Please check below. Is there…
Joseph
  • 7,042
  • 23
  • 83
  • 181
31
votes
8 answers

Toggle button in Iphone Style

In android the Toggle buttons are looks like below - Can we modify this as Iphone style like below - And, Can we include the iphone functionality of toggle button like drag to toggle feature also. How to complete this action? Thanks in Advance.
Praveenkumar
  • 24,084
  • 23
  • 95
  • 173
26
votes
3 answers

WPF Toggle Button Checked/Uchecked event with one handler

I am using a ToggleButton in a WPF window:
Ryan R
  • 8,342
  • 15
  • 84
  • 111
26
votes
4 answers

How to perform two-way data binding with a ToggleButton?

I have an ObservableBoolean field in my activity class, which is bound to the "checked" attribute of my ToggleButton like so: android:checked="@{activity.editing}" I was hoping this would create a two-way relationship between the button and the…
Gregorio246
  • 589
  • 2
  • 7
  • 15
26
votes
5 answers

How do I correctly bind a Popup to a ToggleButton?

I am trying to do something that seems relatively simple and logic from a user interface level but I have one bug that is very annoying. I have a ToggleButton and I am trying to show a Popup when the button is toggled in and hide the Popup when the…
craftworkgames
  • 9,437
  • 4
  • 41
  • 52
25
votes
3 answers

Binding to a WPF ToggleButton's IsChecked state

I would like to use a WPF ToggleButton to expand and collapse some controls in my application. How can I use XAML to accomplish this? I'm thinking that I could somehow bind the Visibility attribute of some controls to the ToggleButton's IsChecked…
sourcenouveau
  • 29,356
  • 35
  • 146
  • 243
25
votes
1 answer

Android: toggle text color of ToggleButton

To create a custom ToggleButton, I've defined a new style in /res/values/styles.xml: