Rectangle 27 0

if you are setting the header to the ListView by inflating a layout, like this:

ListView lv = getListView();
LayoutInflater inflater = getLayoutInflater();
ViewGroup header = (ViewGroup)inflater.inflate(R.layout.header, lv, false);
lv.addHeaderView(header, null, false);

you can change the height of the layout R.layout.header using


You can get Notification or Status Bar height using this code here:

the question is mostly not about setting the height, but about getting it. I can get the full height of the display (480x800 on my phone), but i need to set header height to <screenHeight - notificationBarHeight - smthElse>. So I need to get notificationBarHeight, cause I suppose it could differ between different devices.

so you got your screen height, and smthElse, all you need is notificationBarHeight? I mean what height you exactly want?

yes, you may say I need notificationBarHeight. But I dont want to hardcode it, cause, I suppose, it may vary between different devices

android - Set listview header size programmatically - Stack Overflow

android layout dimensions