Is there anyway to control the text position for a ToggleButton\'s on and off state? For instance, I want the text label to be left aligned when on and right aligned when of
ToggleButton b1 = (ToggleButton) findViewById(R.id.button1); if(b1.isChecked()){ b1.setGravity(Gravity.RIGHT); } else{ b1.setGravity(Gravity.LEFT); }
Note, that you will not see any changes if the button is not of a minimum size (has to be bigger than the lable text).