The margin trick works, but is a bit fragile, since you are relying on the height of the other component. It isn't 'the right way' to do it. The problem is that your frame layout uses a 'fill_parent' height. If the frame fills the parent, where is the room for the tabs? Instead,
you should make the tabs 'wrap_content' like they are, and not specify a height for the frame layout: instead, give them a height of 0dp, and a weight of 1 (which means it will get 1 '
unit' of leftover layout space: since it is the only component needing leftover space it gets it all):