2

アクションバーシャーロックを使っています。Facebookのようなインジケーターを表示したくありません。customactionbar.xml でアイコンのみを使用したいのですが、インジケーターを削除しません。

私のmainpage.xml;

    <?xml version="1.0" encoding="utf-8"?>
    <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
                  android:layout_width="fill_parent"
                  android:layout_height="fill_parent"
                  android:orientation="vertical">
        <fragment
            class="com.google.android.gms.maps.SupportMapFragment"
            xmlns:map="http://schemas.android.com/apk/res-auto"
            android:id="@+id/mapFragment"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_centerHorizontal="true"
            android:layout_centerVertical="true"
            android:name="com.google.android.gms.maps.MapFragment" />
        <android.support.v4.view.ViewPager
                android:id="@+id/pager"
                android:background="#FFFFFFFF"
                android:layout_width="fill_parent"
                android:layout_height="fill_parent"
                android:layout_margin="5dp"
                android:visibility="gone"/>
    </RelativeLayout>

そして私のクラス。

        getSupportActionBar().setDisplayOptions(ActionBar.DISPLAY_SHOW_CUSTOM);
        View absview = getLayoutInflater().inflate(R.layout.customactionbar, null);
        getSupportActionBar().setNavigationMode(ActionBar.NAVIGATION_MODE_TABS);
        getSupportActionBar().setDisplayShowTitleEnabled(false);
        getSupportActionBar().setDisplayShowHomeEnabled(false);
        getSupportActionBar().setCustomView(absview);

        TabControlListener myTabListener = new TabControlListener(this, _viewPager);
        myTabListener.addTabChangedListener(this);

        ActionBar.Tab tab_vehicledetail = getSupportActionBar().newTab();
        myTabListener.addTab(tab_vehicledetail,FragmentDeviceDetail.class,null);
        tab_vehicledetail.setTabListener(myTabListener);

        ActionBar.Tab tab_Notify = getSupportActionBar().newTab();
        myTabListener.addTab(tab_Notify,FragmentDeviceDetail.class,null);
        tab_Notify.setTabListener(myTabListener);

        ActionBar.Tab tab_LastPosition = getSupportActionBar().newTab();
        myTabListener.addTab(tab_LastPosition,FragmentDeviceDetail.class,null);
        tab_LastPosition.setTabListener(myTabListener);

今 http://img27.imageshack.us/img27/9012/screenshot7886652570341.png

4

1 に答える 1

0

PagerTabStrip クラスを作成する必要がありますが、PagerTabStrip を使用する代わりに PagerTitleStrip を使用すると、作業が大幅に軽減されます。

pagerTabStrip を引き続き使用する場合は、タブ インジケーターの色を変更できます。タブストリップの背景色に変更します。

于 2013-09-12T19:54:08.983 に答える