Here is what i am doing in my layout
h = getWindowManager().getDefaultDisplay().getHeight();
Relative Layout = 60 dp = 90 using .getHeight()
Relative Layout = wrap content
Relative layout align bottom = 60 dp = 90
Now my width and height variables are showing height of 800.
I am doing following things
h = h - 180 //
for (int i = 0 ; i < 10 ; i++)
{
TextView tv = new TextView(this);
LayoutParams params = new RelativeLayout.LayoutParams(w/10, h/10);
wordsLayout.addView(tv,params);
}
I have made the code so that each textView goes directly below first one. Now according to code, the remaining height after subtracting heights of relative layouts should make the height of all textviews so that they fill up the empty space.
However this works fine for w/10 or width but for height it always takes more space than empty space. I can’t understand what is happening. How to adjust the height so that it only fills the space
I found the problem, I was missing the fact that the
title bartakes some height of the screen too.