lundi 2 mars 2015

LinearLayout getting cut when moved offscreen



I have a LinearLayout with a button at the top of it, and more views below it. I moved the layout to the bottom of the screen with only the button showing. When you click the button it slide ups properly, but then the rest of the layout is chopped off.


Here's the code that moves the LinearLayout to the bottom of the screen.



test = (LinearLayout) findViewById(R.id.test);
RelativeLayout.LayoutParams layoutParams=new RelativeLayout.LayoutParams(RelativeLayout.LayoutParams.WRAP_CONTENT, RelativeLayout.LayoutParams.WRAP_CONTENT);
layoutParams.setMargins(0,height-buttonH-50,0,0);
test.setLayoutParams(layoutParams);


Height is the height of the screen, and buttonH is the button height. I had to subtract the 50 because it was scrunched up. How could I stop it from cutting off the rest of the LinearLayout??




Aucun commentaire:

Enregistrer un commentaire