Android的具有屏幕底部的标签? [英] Android having tabs at the bottom of screen?

查看:160
本文介绍了Android的具有屏幕底部的标签?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想放置在屏幕的底部卡并每个选项卡显示不同的活动。

I am trying to place tabs on the bottom of the screen and have each tab display a different activity.

不过从我读过你只能在手机上3.0 +使用此功能。

However from what I have read you can only use this on phones 3.0+.

当大多数手机,我知道是约2.3,这似乎有点可笑。

When most phones I know are around 2.3 this seems a little ridiculous.

任何人有什么想法?

推荐答案

这可以使用了Android常用的标签来实现,只是你所要做的就是添加一些额外的codeS在xml.I希望这块$的ç$ C可以帮助你得到它做...

This can be implemented using the android usual tab,just you have to do is add some extra codes in the xml.I hope this piece of code will help you for getting it done...

<TabHost 
        android:layout_width="fill_parent"
        android:layout_height="fill_parent"
        xmlns:android="http://schemas.android.com/apk/res/android"
        android:id="@android:id/tabhost"
        android:background="@android:color/background_dark"

>

    <RelativeLayout
        android:id="@+id/LinearLayout01"
        android:layout_width="fill_parent"
        android:layout_height="fill_parent"
        android:orientation="vertical" >

        <FrameLayout
            android:id="@android:id/tabcontent"
            android:layout_width="fill_parent"
            android:layout_height="match_parent" 
            android:layout_above="@android:id/tabs">
        </FrameLayout>

        <TabWidget
            android:id="@android:id/tabs"
            style="@style/customtab"
            android:layout_width="fill_parent"
            android:layout_height="wrap_content"
            android:layout_alignParentBottom="true"

           >
        </TabWidget>
    </RelativeLayout>

</TabHost>

风格是这里@风格/ customtab

The style is here @style/customtab

   <style name="customtab" parent="@android:style/Widget.TabWidget">
            <item name="android:tabStripEnabled">false</item>
            <item name="android:tabStripLeft">@null</item>
            <item name="android:tabStripRight">@null</item>
        </style>

这篇关于Android的具有屏幕底部的标签?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆