在应用程序里已经自定义了窗口标题栏,但是运行程序的时候会先显示默认的标题栏,我添加了一个透明背景,但是无效。
custom_title.xml:
<resources>
<style name="CustomWindowTitleBackground">
<item name="android:background">@android:color/transparent</item>
</style>
<style name="CustomTheme" parent="android:Theme">
<item name="android:windowTitleSize">35dip</item>
<item name="android:windowTitleBackgroundStyle">@style/CustomWindowTitleBackground</item>
</style>
多谢帮忙~
试试实现全屏的Activity和noTitleBar。然后在Activity中创建一个继承自定义标题栏的layout。如下:
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical"
android:layout_width="fill_parent" android:layout_height="fill_parent">
<your custom title bar/>
<your main layout/>
</LinearLayout>
然后用户运行Activity时,默认的标题栏就被隐藏了,这个和自定义标题一样的会先显示。