Theme theme is used to set the UI style of the interface, you can set the entire application or an activity of the interface style. The following theme are built into the Android SDK and can be categorized by whether the title bar and status bar status bars are visible:
Copy Code code as follows:
Android:theme= "@android: Style/theme.dialog" displays an activity as an energy-box mode
Android:theme= "@android: Style/theme.notitlebar" does not display the application title bar
Android:theme= "@android: Style/theme.notitlebar.fullscreen" does not display the application title bar and is full screen
Android:theme= "Theme.light" background is white
Android:theme= "Theme.Light.NoTitleBar" white background with no title bar
Android:theme= "Theme.Light.NoTitleBar.Fullscreen" white background, no title bar, full screen
Android:theme= "Theme.black" background black
Android:theme= "Theme.Black.NoTitleBar" black background with no title bar
Android:theme= "Theme.Black.NoTitleBar.Fullscreen" black background, no title bar, full screen
Android:theme= "Theme.wallpaper" with system desktop for application background
Android:theme= "Theme.Wallpaper.NoTitleBar" with the system desktop as the application background with no title bar
Android:theme= "Theme.Wallpaper.NoTitleBar.Fullscreen" with system desktop for application background, no title bar, full screen
Android:theme= "Translucent" translucent
Android:theme= "Theme.Translucent.NoTitleBar" translucent, no title bar
Android:theme= "Theme.Translucent.NoTitleBar.Fullscreen" translucent, no title bar, full screen
Android:theme= "Theme.panel"
Android:theme= "Theme.Light.Panel"
Copy Code code as follows:
Android:theme= "@android: Style/theme.dialog" displays an activity as an energy-box mode
Android:theme= "@android: Style/theme.notitlebar" does not display the application title bar
Android:theme= "@android: Style/theme.notitlebar.fullscreen" does not display the application title bar and is full screen
Android:theme= "Theme.light" background is white
Android:theme= "Theme.Light.NoTitleBar" white background with no title bar
Android:theme= "Theme.Light.NoTitleBar.Fullscreen" white background, no title bar, full screen
Android:theme= "Theme.black" background black
Android:theme= "Theme.Black.NoTitleBar" black background with no title bar
Android:theme= "Theme.Black.NoTitleBar.Fullscreen" black background, no title bar, full screen
Android:theme= "Theme.wallpaper" with system desktop for application background
Android:theme= "Theme.Wallpaper.NoTitleBar" with the system desktop as the application background with no title bar
Android:theme= "Theme.Wallpaper.NoTitleBar.Fullscreen" with system desktop for application background, no title bar, full screen
Android:theme= "Translucent" translucent
Android:theme= "Theme.Translucent.NoTitleBar" translucent, no title bar
Android:theme= "Theme.Translucent.NoTitleBar.Fullscreen" translucent, no title bar, full screen
Android:theme= "Theme.panel"
Android:theme= "Theme.Light.Panel"
These topics can be applied to the entire application application scope or to an activity scope.
Apply Application Range
The theme property is set in the application node in Androidmanifest.xml, and the theme theme applied to the entire application.
Copy Code code as follows:
<application
android:icon= "@drawable/icon"
android:icon= "@string/app_name"
Android:icon= "@android: Style/theme.black.notitlebar" >
Activity Range
The theme is applied to the current activity only by using Java code or by setting the subject of the active activity in Androidmanifest.xml.
To set the method in Androidmainifest.xml:
Copy Code code as follows:
<activity
Android:name= ". About "
Android:label= "@string/app_name"
Android:theme= "@android: Style/theme.black.notitlebar" >
Set using Java code, set in the OnCreate of the current active activity:
Copy Code code as follows:
@Override
public void OnCreate (Bundle savedinstancestate) {
Super.oncreate (savedinstancestate);
Settheme (Android. R.style.theme_translucent_notitlebar);
Setcontentview (R.layout.main);
}
-------------Jump---------------------
Copy Code code as follows:
public void Start () {
New Thread () {
public void Run () {
try {
Thread.Sleep (3000);
catch (Interruptedexception e) {
E.printstacktrace ();
}
Intent Intent = new Intent ();
Intent.setclass (Welcomeactivity.this, Mainactivity.class);
StartActivity (Intent);
Finish ();
}
}.start ();
}
---------to add the effect to the button-----------
Copy Code code as follows:
ImageButton1 = (ImageButton) Findviewbyid (R.id.imagebutton3);
Imagebutton1.setontouchlistener (New Ontouchlistener () {
Public boolean ontouch (View V, motionevent event) {
if (event.getaction () = = Motionevent.action_down) {
//change to background picture when pressed
V.setbackgroundresource (r.drawable.menu_ Btn_f);
} else if (event.getaction () = motionevent.action_up) {
/////////////////////// NU_BTN);
}
return false;
}
});