1
I want this effect.The tab is in the toolbar,not under the toolbar如何把tablayout到工具欄,它們在
我找遍了所有的網站,但無法找到一個方法來做到這一點thing.All文檔告訴我如何添加一個Android開發者在同一行標籤工具欄下的,但它不是我想要什麼
I want this effect.The tab is in the toolbar,not under the toolbar如何把tablayout到工具欄,它們在
我找遍了所有的網站,但無法找到一個方法來做到這一點thing.All文檔告訴我如何添加一個Android開發者在同一行標籤工具欄下的,但它不是我想要什麼
我只是想出了答案,這是簡單的比我吼聲:
<android.support.design.widget.AppBarLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<android.support.v7.widget.Toolbar
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:popupTheme="@style/ThemeOverlay.AppCompat.Light">
<android.support.design.widget.TabLayout
android:id="@+id/main_tabs"
style="@style/MainTabLayout"
app:tabIndicatorHeight="0dp"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@+id/home_toolbar"/>
</android.support.v7.widget.Toolbar>
</android.support.design.widget.AppBarLayout>
因此,我們有。 這不是完全相同的設計,但你只需改變任何你想要的。 不要忘記設置工具欄上的片段或活動:
Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
setSupportActionBar(toolbar);
這是作爲一個我們的[鏈接]上看到(http://i.stack.imgur.com/zYrUr同樣的效果.jpg「棒棒糖時鐘」)。 我正在尋找相同的答案,如果我找到它,我會提醒我回到這裏=) – LeonardoSibela