【问题标题】:How Can I remove ViewPager Indicator如何删除 ViewPager 指示器
【发布时间】:2013-06-10 14:13:50
【问题描述】:

我使用 actionbarsherlock。我不想显示像 facebook 这样的指标。我只想在 customactionbar.xml 上使用图标,但我不删除指示符。

我的主页.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);

a Now http://img27.imageshack.us/img27/9012/screenshot7886652570341.png

【问题讨论】:

    标签: android android-layout actionbarsherlock android-viewpager


    【解决方案1】:

    你必须写一个PagerTabStrip类,但是不用PagerTabStrip你可以使用PagerTitleStrip会大大减少工作量。

    如果您仍想使用 pagerTabStrip,您可以更改选项卡指示器的颜色。将其更改为您的标签条背景颜色。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2021-09-09
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多