Android FragmentTabHost向可滚动的TabWidget添加一个持久按钮

Android FragmentTabHost向可滚动的TabWidget添加一个持久按钮,android,Android,我想在TabWidget的右端添加一个按钮。 TabWidget位于HorizontalScrollView中(在代码中添加) 但按钮不能与标签一起滚动, 但始终保持在选项卡栏的右侧 我不确定是否可以用这种方式定制TabWidget,所以另一个想法是 将这样的按钮放置在TabWidget旁边 我尝试了下面的布局,但是文本视图没有出现。 所以我的问题是,这通常是可行的,还是我需要一种不同的方法 <?xml version="1.0" encoding="utf-8"?> <and

我想在TabWidget的右端添加一个按钮。 TabWidget位于HorizontalScrollView中(在代码中添加) 但按钮不能与标签一起滚动, 但始终保持在选项卡栏的右侧

我不确定是否可以用这种方式定制TabWidget,所以另一个想法是 将这样的按钮放置在TabWidget旁边

我尝试了下面的布局,但是文本视图没有出现。 所以我的问题是,这通常是可行的,还是我需要一种不同的方法

<?xml version="1.0" encoding="utf-8"?>
<android.support.v4.app.FragmentTabHost
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:id="@+id/content_tabhost"
    android:orientation="vertical"
    android:layout_width="match_parent"
    android:layout_height="match_parent">

<LinearLayout
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="vertical" >

    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:orientation="horizontal" >

        <TabWidget
            android:id="@android:id/tabs"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"/>


        <TextView
            android:id="@+id/tab_search"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="SEARCH HERE"/>

    </LinearLayout>

    <FrameLayout
        android:id="@+id/content_body"
        android:layout_width="match_parent"
        android:layout_height="match_parent"/>
</LinearLayout>

</android.support.v4.app.FragmentTabHost>


我解决了这个问题,我扔掉了FragmentTabHost并编写了自己的选项卡(这很容易定制)。如果你想知道详情,请与我联系。总有一天我也会把这个推到我的github repo.im上,你能分享你的代码吗?