我正在使用此庫https://github.com/astuetz/PagerSlidingTabStrip來創建PagerTabStrip。PagerTabStrip - 將選項卡居中或使它們適合
我的輸出
你可以看到,我的標籤後,我有一些空的空間。 我想使標籤適合所有屏幕,或至少居中標籤。 這可能嗎?
<com.astuetz.PagerSlidingTabStrip
android:layout_gravity="center_horizontal"
android:gravity="center_horizontal"
android:background="@color/facebook_theme_light"
android:id="@+id/activity_posts_tabs"
android:layout_width="match_parent"
android:layout_height="48dip" />
<android.support.v4.view.ViewPager
android:background="@color/facebook_theme_dark"
android:id="@+id/activity_posts_pager"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@id/activity_posts_tabs"
tools:context=".MainActivity" />
是的,這是一個很好的解決方案:) – 2015-04-19 19:40:58