获取Android SDK中的WebView和TabWidget发挥好 [英] Getting Android SDK WebView and TabWidget to play nice
问题描述
我正在在 HelloTabWidget Android的例子,并试图两件事情:
I’m taking the HelloTabWidget Android example and trying two things:
- 移动标签的底部主场迎战
顶部(如果这是可取的,甚至从Android UI POV) - 使每个选项卡显示特定
的WebView 以上 空间
- Moving the tabs to the bottom vs. the top (if that’s even desirable from an Android UI POV)
- Making each tab show a particular WebView in the space above
我这有一个布局(高电平):
I’ve got this for a layout (high level):
<TabHost>
<LinearLayout>
<FrameLayout>
<WebView/>
<WebView/>
<WebView/>
<WebView/>
<WebView/>
</FrameLayout>
<TabWidget/>
</LinearLayout>
</TabHost>
任何事物都有一个宽度/高度设置为 FILL_PARENT
除了 TabWidget 有其 layout_height
设置为 WRAP_CONTENT
(和 layout_gravity
设置为底
)。
Everything has a width/height set to fill_parent
except for the TabWidget which has its layout_height
set to wrap_content
(and the layout_gravity
set to bottom
).
我注意到的第一件事是,的WebView ■不要显示任何东西,直到所有的父母有宽度/高度设置为 FILL_PARENT
。但是,一旦我做到这一点,他们填满了整个显示,模糊的 TabWidget
First thing I noticed is that WebViews don’t show anything until all the parents have width/height set to fill_parent
. However, once I do that, they fill the entire display, obscuring the TabWidget.
有一些其他的诀窍使这两种观点很好地一起玩?
Is there some other trick to making these two views play nicely together?
推荐答案
据我所知,标签不会在底部运行。
AFAIK, tabs will not work at the bottom.
TabHost
和的WebView
罚款共同努力,虽然我没有演示此当前样本。
TabHost
and WebView
work fine together, though I do not have a current sample that demonstrates this.
这篇关于获取Android SDK中的WebView和TabWidget发挥好的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!