Sunday, 25 August 2013

How to make RelativeLayout not take up the whole screen?

How to make RelativeLayout not take up the whole screen?

Currently, I have a relative layout defined programatically
RelativeLayout layout = new RelativeLayout(this);
then I add textviews and buttons like this
layout.addView(myText, params);
layout.addView(myBtn, param);
However, this makes the entire screen fill up with my relativelayout, how
do I (programatically) set only certain number of pixels(dp) take up the
screen? My goal is to have like the bottom half of the screen
relativelayout
Anyhelp?

No comments:

Post a Comment