</pre><pre name="code" class="html"><!--Atomu's theme-->
<style name="AppThemeWithCustomTitle" parent="Theme.AppCompat.Light.DarkActionBar">
<item name="android:headerBackground">@color/blue</item>
<item name="android:windowActionBar">false</item>
<item name="android:windowTitleSize">50dp</item>
<item name="android:windowTitleBackgroundStyle">@style/TitleBarStyle</item>
</style>
<style name="TitleBarStyle">
<item name="android:background">@color/blue</item>
</style>
首先改变theme, 去掉默认标题栏
super.onCreate(savedInstanceState);
requestWindowFeature(Window.FEATURE_CUSTOM_TITLE)