how to set visiblity in android for seekbar and textview -
**there switch button , seek bar , text view in above image
when activity starts . want seek bar , text view invisible default , when switch on switch button , both seek bar , text view should visible please provide simple code operation .
i have tried using gone ,visible , invisible stuffs . not showing effect.
**
have tried below?
@override protected void oncreate(bundle savedinstancestate){ setcontentview(r.layout.activity_main); // find view id here textview.setvisiblity(view.gone); seekbar.setvisiblity(view.gone); myswitch.setoncheckedchangelistener(new compoundbutton.oncheckedchangelistener() { public void oncheckedchanged(compoundbutton buttonview, boolean ischecked) { // something, ischecked // true if switch in on position if(ischecked){ textview.setvisiblity(view.visible); seekbar.setvisiblity(view.visible); }else{ textview.setvisiblity(view.gone); seekbar.setvisiblity(view.gone); } } }); }
Comments
Post a Comment