Android ScrollView's scroll disable when set width & height programically -


i had following structure in android application

linearlayout      scrollview           linearlayout            -- elements --- 

then need set width & height of scrollview programically. wrote following code

scrollview sv=(scrollview)activity.findviewbyid(r.id.menuscroll); linearlayout.layoutparams relp=new linearlayout.layoutparams(width/2,height-margin); relp.setmargins(width, 0, 0, 0); sv.setlayoutparams(relp); 

but when added setlayoutparams, scroll property. can't scrolling internal elements. idea ? new android.

thanks

i use relativelayout:

 private scrollview mscrollview;  mscrollview = (scrollview) findviewbyid(r.id.scrollview);   relativelayout.layoutparams layoutparams = (relativelayout.layoutparams) mscrollview.getlayoutparams();  layoutparams.leftmargin= width;  layoutparams.setmargins(width, 0, 0, 0);  mscrollview.setlayoutparams(layoutparams); 

this works me. think that's similar linearlayout.


Comments

Popular posts from this blog

html - Sizing a high-res image (~8MB) to display entirely in a small div (circular, diameter 100px) -

java - IntelliJ - No such instance method -

identifier - Is it possible for an html5 document to have two ids? -