Android 中的选项卡主机问题
我想在屏幕底部显示一个选项卡,所以我使用
<TabHost
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@android:id/tabhost"
android:layout_width="fill_parent"
android:layout_height="wrap_content" >
<RelativeLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical"
android:padding="5dp" >
<FrameLayout
android:id="@android:id/tabcontent"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:padding="5dp" >
</FrameLayout>
<TabWidget
android:id="@android:id/tabs"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_alignBottom="@android:id/tabcontent" />
</RelativeLayout>
</TabHost>
但也想在选项卡小部件下方显示一个按钮。在屏幕底部,我们有一个按钮和一个选项卡小部件,该小部件位于按钮上方,但应位于屏幕底部。
有任何方法可以做到这一点。
请向我推荐可用的链接或示例代码。
I want to display a tab at bottom of screen , so i use
<TabHost
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@android:id/tabhost"
android:layout_width="fill_parent"
android:layout_height="wrap_content" >
<RelativeLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical"
android:padding="5dp" >
<FrameLayout
android:id="@android:id/tabcontent"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:padding="5dp" >
</FrameLayout>
<TabWidget
android:id="@android:id/tabs"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_alignBottom="@android:id/tabcontent" />
</RelativeLayout>
</TabHost>
but also want to display a button below tab widget . At bottom of screen , we have a button and a tab widget which is above button but should be at bottom of screen .
There is any way for doing it.
Please suggest me usable link or sample code.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
使用线性布局并将 tabhost 和按钮放入其中
use linear-layout and put the tabhost and button in it
我不确定,但采用一种线性或相对布局。
首先放置 TabHost,然后在 TabHost 下方的新布局中放置一个按钮。
我没用过,但我认为它会起作用
I am not sure but take one Linear or Relative Layout.
Put TabHost first and then put a button in that new Layout below TabHost.
I have not used it but I think it will work