吐槽一下,百度查出来的太坑比了,查了半天怎么设置Label的样式,,给我看的都是要不就是设置theme,要不就是设置titleview,,真欺负我不会啊。。。。
<activity
android:name="yuku.alkitab.base.ac.SearchActivity"
android:configChanges="keyboardHidden|orientation|screenSize|locale|layoutDirection|fontScale"
android:label="@string/search"
android:windowSoftInputMode="adjustResize" />
我想设置这里的Label样式,因为是已有的项目,如果自定义标题太麻烦了,只想通过设置一个样式文件就可以修改
在res->values->style设置样式
<style name="TitleBarTextAppearance" parent="android:TextAppearance">
<item name="android:fontFamily">@font/your_desired_font</item>
<item name="android:textSize">23sp</item>
<item name="android:textStyle">bold</item>
<item name="android:textColor">@android:color/white</item>
</style>
设置toolbar
<android.support.v7.widget.Toolbar
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:background="?attr/colorPrimary"
app:titleTextAppearance="@style/TitleBarTextAppearance"
app:popupTheme="@style/AppTheme.PopupOverlay"/>