us take a look at default themes supplied with Android SDK. Below themes will control the background, status bar and title bar.
Status bar: Visible | Status bar: Visible | Status bar: Invisible | |
Title bar: Visible | Title bar: Invisible | Title bar: Invisible | |
Theme | Theme.NoTitleBar | Theme.NoTitleBar.Fullscreen | |
Theme.Black | Theme.Black.NoTitleBar | Theme.Black.NoTitleBar.Fullscreen | |
Theme.Light | Theme.Light.NoTitleBar | Theme.Light.NoTitleBar.Fullscreen | |
Theme.Translucent | Theme.Translucent.NoTitleBar | Theme.Translucent.NoTitleBar.Fullscreen |
剩余的就是修改里面的参数了
<activity
android:name=“.Welcome”
android:label=“@string/app_name”
android:theme=“@android:style/Theme.Translucent.NoTitleBar” >
setTheme(android.R.style.Theme_Translucent_NoTitleBar);
setContentView(R.layout.main);
<?xml version=“1.0″ encoding=“utf-8″?>
<resources>
<style name=“MyTheme”>
HERE DEFINE ALL THE ATTRIBUTES
</style>