我正在尝试更新我的应用,并希望让工具栏看起来像黑色播放器。截至目前我能够设置搜索和导航,但如何将寻呼机标题条放在中间作为内部viewpager我不能使用重力我尝试边缘和填充根本不工作。
这是我的xml
<com.antonyt.infiniteviewpager.InfiniteViewPager
android:id="@+id/pager"
android:layout_width="match_parent"
android:layout_height="match_parent">
<me.alexrs.fontpagertitlestrip.lib.FontPagerTitleStrip
android:id="@+id/titlestrip"
android:layout_width="wrap_content"
android:layout_height="50dp"
android:layout_marginEnd="50dp"
android:layout_marginStart="50dp"
android:background="@color/material_fragment_top"
app:fontFamily="@font/font"
app:theme="@style/AppTheme.PopupOverlay" />
</com.antonyt.infiniteviewpager.InfiniteViewPager>
<android.support.v7.widget.Toolbar
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="50dp"
app:theme="@style/CustomActionBar" />
我如何把pagertitlestrip放在中间
答案 0 :(得分:0)
好像你想改变StatusBarColor。
尝试setStatusBarColor(int)
并设置工具栏的颜色,或者可以使其透明
您需要做的就是在主题中设置这些属性:
<item name="android:windowTranslucentStatus">true</item>
<item name="android:windowTranslucentNavigation">true</item>
您希望拥有透明状态栏的活动/容器布局需要设置此属性:
android:fitsSystemWindows="true"
但是既然您从未指定过您正在使用的API,我会向您推荐不同的问题,您应该找到答案。