在我的应用中,我有一个没有动作栏的主题,但是对于我的一项活动,我需要一个带有白色标题的动作栏。所以,这是代码:
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools" 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:minHeight="?attr/actionBarSize"
android:background="@color/color_primary"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:title="Title"
app:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar"
app:popupTheme="@style/ThemeOverlay.AppCompat.Light"/>
<fragment android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_below="@id/toolbar"
android:id="@+id/map"
android:name="com.google.android.gms.maps.SupportMapFragment"/>
</RelativeLayout>
如您所见,此活动还包含Google Maps Fragment。
结果:
如您所见,标题颜色不是白色。为什么?我想知道。
@Raghunandan后:这个字符串只需添加到您AppBaseTheme
在styles.xml
:
<item name="android:textColorPrimary">@android:color/white</item>
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句