android - Disabling children of framelayout that contains a scrollView -
i have custom framelayout
contains scroll view 1 of elements. want disable children of scrollview , doesnt seem working
i calling method in onlayout of framelayout
private void disabledescendants(viewgroup v) { (int = 0; < v.getchildcount(); i++) { if (v.getchildat(i) instanceof viewgroup) { disabledescendants((viewgroup) v.getchildat(i)); } v.setenabled(false); v.setfocusable(false); v.setfocusableintouchmode(false); } }
yet edittextss
in scrollview
, , scrollview
don't seem disabled. can click on them bring keyboard up.
how can create them disabled?
why getchildcount() might not work : android: difference between getcount() , getchildcount() in listview
try :
scrollview scrollview = (scrollview) findviewbyid(r.id.scrollview); ( int = 0; < scrollview.getchildcount(); i++ ){ view view = scrollview.getchildat(i); view.setenabled(false); }
android scrollview
No comments:
Post a Comment