I have GridView in LinearLayout in Fragment. I'm using ViewPager with few fragments, one in each page. Under ViewPager i have indicator. I'm using RelativeLayout as a root of layout and ViewPager is above indicator. Every of fragments in pager have GridView with 4 cells (2 columns x 2 rows).
In phone everything looks alright, but when i run my app on tablet i have a lot of empty space under GridView. One row of GridView have height in about 1/4 of available space, so GridView using only 1/2 empty space. In every cell i have only ImageView, and for some reason it looks like there have margins in sides.
How can measure and set height for row or cell or gridview? I've tried this solution but its not work for me.