android中的标签布局默认的事把标签放在上方,
从网上看到可以让标签放在屏幕的底部,但是不知道怎么把标签放在屏幕的左边或者右边
有经验的分享一下啊 

解决方案 »

  1.   

    目前发现只可以顶部和底部
    左边和右边不知道能不能实现
    其实你可以选择其他的控件来替代 tabhost并不是很好
    tab多的时候看起来就很难看
      

  2.   

    呵呵,重写是可以放到底部的,但是我觉得放到底部的对于系统自带的十分不协调,不如自己模拟一个tab,其实很简单的,几个button,加一个标记,做一个互斥仅仅显示一个是激活的就行了, android系统自带的控件没一个看着顺眼好用的,还是自己子类化view来得好
      

  3.   

    自已重写一个,每个标签是一个View。把View放到LinearLayout里面就可以了。
      

  4.   

    自定义一个XML就可以了,顺便设置按钮点击的时候SetCurrentTag就行了.不用覆盖类,可以左右上下.-- 只不过我没有想到如何处理圆角的图片背景.
      

  5.   

    发表一下看法!其实你去看下源代码,TabHost是继承自LinearLayout的,因此它是一个线性布局,正常情况下都是标签在上,内容在下,下面我们可以实现标签在下,布局在上,相信大家看了肯定能懂,因为这是一个普通的垂直线性布局,代码:<TabHost
    android:id="@android:id/tabhost"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent">
    <LinearLayout
    android:orientation="vertical"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent">
    <FrameLayout
    android:id="@android:id/tabcontent"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:layout_weight="1" />
    <TabWidget
    android:id="@android:id/tabs"
    android:layout_width="fill_parent"
    android:layout_height="50dip"
    android:layout_weight="0"
    android:paddingTop="3dip"
    android:background="#69DADA" />
    -->
    </LinearLayout>
    </TabHost>因此,如果你想布置标签在坐标的,代码如下:
    <TabHost
    android:id="@android:id/tabhost"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent">
    <LinearLayout
    android:orientation="horizontal"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent">
    <FrameLayout
    android:id="@android:id/tabcontent"
    android:layout_height="fill_parent"
    android:layout_width="wrap_content"
    android:layout_weight="1" />
    <TabWidget
    android:id="@android:id/tabs"
    android:layout_height="fill_parent"
    android:layout_width="50dip"
    android:layout_weight="0"
    android:paddingTop="3dip"
    android:background="#69DADA" />
    -->
    </LinearLayout>
    </TabHost>好了,标签在左侧的布局就是这样的,相信在右侧的你也学会了!