1

http://jgilfelt.github.io/android-actionbarstylegeneratorに基づいてアプリケーションのカスタム スタイルを生成しました。

ただし、アプリケーションに統合しようとすると、ページのいずれかの fragmenttabhost に対してスタイルが機能しません。スタイルの残りの部分は、アクションバーなどで正常に機能しています。

以下は私のfragmenttabhostです

 public final class DashBoardFragmentTabHost extends SherlockFragment  {
    private FragmentTabHost mTabHost;
    public DashBoardFragmentTabHost()
    {
        setHasOptionsMenu(true);

    }

    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {

    try{

        mTabHost = new FragmentTabHost(getSherlockActivity());
        mTabHost.setup(getActivity(), getChildFragmentManager(), R.layout.fragment_tabhost);
            mTabHost.addTab(mTabHost.newTabSpec("abc").setIndicator("abc"),
                abc.class, null);
        mTabHost.addTab(mTabHost.newTabSpec("def").setIndicator("def"),
                def.class, null);
        mTabHost.addTab(mTabHost.newTabSpec("ghi").setIndicator("ghi"),
                ghi.class, null);



        //mTabHost.set (getResources().getDrawable(R.drawable.tab_indicator_ab_safetyblue));



    }
    catch (Exception e) {
        // TODO: handle exception
    }
        return mTabHost;


    }



}

fragment_tabs.xml

<TabHost
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:id="@android:id/tabhost"
    android:layout_width="match_parent"
    android:layout_height="match_parent">

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

        <TabWidget
            android:id="@android:id/tabs"
            android:orientation="horizontal"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_weight="0"/>

        <FrameLayout
            android:id="@android:id/tabcontent"
            android:layout_width="0dp"
            android:layout_height="0dp"
            android:layout_weight="0"/>

        <FrameLayout
            android:id="@+android:id/realtabcontent"
            android:layout_width="match_parent"
            android:layout_height="0dp"
            android:layout_weight="1"/>

    </LinearLayout>
</TabHost>
4

0 に答える 0