动作条的标签就像在雅虎邮件应用程序 [英] ActionBar tabs like in the yahoo mail app
本文介绍了动作条的标签就像在雅虎邮件应用程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我在Android的初学者。我的问题是如何创建动作条的标签,如雅虎邮件?
采取以下
I'm a beginner in Android. My question is how to create ActionBar tabs like yahoo mail?
Take a look at the image below
推荐答案
使用 https://github.com/astuetz / PagerSlidingTabStrip 你可以把标签上的工具栏。
Using https://github.com/astuetz/PagerSlidingTabStrip you can put the tabs over the toolbar.
<?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>
这篇关于动作条的标签就像在雅虎邮件应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文