2016-04-27 32 views
0

簡單是或否我認爲就足夠了,我知道我可以創建自己的選項卡,並使它們看起來像新的材料設計的,並有完全控制在那裏的位置,但我有點希望我能達到我想要的結果使用支持庫, 我已經按照教程設置了我的素材選項卡,他們需要一些非常漂亮的擦亮劑,但它們工作得很好。我可以從應用程序工具欄分離android素材選項卡嗎?

screenshot 1

除ID實在很喜歡,是一半時我的應用程序查看這 - 像

screenshot 2

我已經嘗試築巢的意見,但至今只設法移動整個屏幕。

screenshot3

沒有任何人有一個快速的解決或解決方法這還是這只是它是如何?

<?xml version="1.0" encoding="utf-8"?> 
<android.support.design.widget.CoordinatorLayout  
xmlns:android="http://schemas.android.com/apk/res/android" 
xmlns:app="http://schemas.android.com/apk/res-auto" 
xmlns:tools="http://schemas.android.com/tools" 
android:layout_width="match_parent" 
android:layout_height="match_parent" 
android:fitsSystemWindows="true" 
tools:context=".MainActivity"> 

<android.support.design.widget.AppBarLayout 
    android:layout_width="match_parent" 
    android:layout_height="wrap_content" 
    android:theme="@style/AppTheme.AppBarOverlay"> 

    <android.support.v7.widget.Toolbar 
     android:id="@+id/toolbar" 
     android:layout_width="match_parent" 
     android:layout_height="?attr/actionBarSize" 
     android:background="?attr/colorPrimary" 
     app:popupTheme="@style/AppTheme.PopupOverlay" /> 

    <android.support.design.widget.TabLayout 
     android:id="@+id/tabs" 
     android:layout_width="match_parent" 
     android:layout_height="wrap_content" 
     app:tabMode="scrollable" 
     app:tabGravity="fill" /> 

<android.support.v4.view.ViewPager 
    android:id="@+id/viewpager" 
    android:layout_width="match_parent" 
    android:layout_height="match_parent" 
    app:layout_behavior="@string/appbar_scrolling_view_behavior" /> 


</android.support.design.widget.AppBarLayout> 

<include layout="@layout/content_main" /> 


<android.support.design.widget.FloatingActionButton 
    android:id="@+id/fab" 
    android:layout_width="wrap_content" 
    android:layout_height="wrap_content" 
    android:layout_gravity="bottom|end" 
    android:layout_margin="@dimen/fab_margin" 
    android:src="@drawable/plus" /> 

    </android.support.design.widget.CoordinatorLayout> 
+0

能否請您共享您的XML /佈局代碼這讓我可以回顧一下 – Nullpoint

+0

,@Magnar ive在代碼中加入了代碼 –

回答

0

管理來解決這一點,是因爲我的標籤被嵌套在我的工具欄,所以取出來讓我給他們走動的地方,我想

+0

你應該放置代碼修復,以便其他人可以從中受益 – Nullpoint

相關問題