Forums Register Login

Activity content overlapping TabView

+Pie Number of slices to send: Send
Hello all,

I want to make an app with TabView. TabView contains 3 activities. My Activity layout is a ScrollView and overlapping the tabs at bottom. I am attaching the image of screen with tab.

Here is my xml file for TabView-

This is my xml file for activity contents-
error.png
[Thumbnail for error.png]
+Pie Number of slices to send: Send
You have the Tabs and the Tab Content in the same FrameLayout, so when you put the content in, the tabs get covered. The TabWidget should go outside the FrameLayout and inside the LinearLayout, as it is not part of the tabcontent.
+Pie Number of slices to send: Send
 

Steve Luke wrote:You have the Tabs and the Tab Content in the same FrameLayout, so when you put the content in, the tabs get covered. The TabWidget should go outside the FrameLayout and inside the LinearLayout, as it is not part of the tabcontent.


I tried this but now the tab is not visible.
+Pie Number of slices to send: Send
Try putting bottom margin for the layout that appears on top of the tab widgets, and the margin height should be >= height of tab.
+Pie Number of slices to send: Send
I tried putting bottom margin in scroll view. It worked. Thanks
1
+Pie Number of slices to send: Send
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):
+Pie Number of slices to send: Send
It worked perfectly Steve
Thanks
"How many licks ..." - I think all of this dog's research starts with these words. Tasty tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com


reply
reply
This thread has been viewed 5061 times.
Similar Threads
how to add a scrollbar to a view
Need Help on the scrolling Bar in Android?
Layout issue-footer image to the bottom of screen (Landscape & portrai) irrespective of body content
regarding layout
Layouts, bottom position
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 19, 2024 02:55:00.