2015-05-22 4 views

ответ

0

Использование https://github.com/astuetz/PagerSlidingTabStrip вы можете положить вкладки на панель.

<?xml version="1.0" encoding="utf-8"?> 
<RelativeLayout 
    xmlns:android="http://schemas.android.com/apk/res/android" 
    xmlns:app="http://schemas.android.com/apk/res-auto" 
    android:layout_width="match_parent" 
    android:layout_height="match_parent"> 

    <android.support.v7.widget.Toolbar 
     android:id="@+id/toolbar" 
     android:layout_width="match_parent" 
     android:layout_height="wrap_content" 
     android:background="@color/primary" 
     android:minHeight="56dp" 
     app:popupTheme="@style/ThemeOverlay.AppCompat.Light" 
     app:theme="@style/ThemeOverlay.AppCompat.Dark"/> 


    <com.astuetz.PagerSlidingTabStrip 
     android:id="@+id/tabs" 
     android:layout_width="wrap_content" 
     android:layout_height="56dp" 
     android:layout_alignParentRight="true" 
     android:background="@color/primary" 
     app:pstsActivateTextColor="@color/white" 
     app:pstsDeactivateTextColor="#66323232" 
     app:pstsDividerColor="@color/primary" 
     app:pstsIndicatorColor="@color/white" 
     app:pstsIndicatorHeight="2dp" 
     app:pstsShouldExpand="true" 
     app:pstsTabSwitch="true" 
     app:pstsUnderlineHeight="0dp"/> 


    <android.support.v4.view.ViewPager 
     android:id="@+id/pager" 
     android:layout_width="match_parent" 
     android:layout_height="match_parent" 
     android:layout_below="@+id/tabs"/> 

</RelativeLayout> 

enter image description here

+0

У меня есть ошибка XML для использования Efole

+0

Какая ошибка? –

Смежные вопросы