Android App interface theme theme how to use

Source: Internet
Author: User

Theme theme is used to set the UI style of the interface, you can set the entire application or an activity's interface style. The following theme are built into the Android SDK and can be categorized by title bar and status bar:

[HTML]View Plaincopyprint?
  1. •android:theme="@android: Style/theme.dialog" displays an activity as a box mode
  2. •android:theme="@android: Style/theme.notitlebar" does not display the application title bar
  3. •android:theme="@android: Style/theme.notitlebar.fullscreen" does not display the application title bar and full screen
  4. •android:theme="theme.light" background is white
  5. •android:theme="Theme.Light.NoTitleBar" white background with no title bar
  6. •android:theme="Theme.Light.NoTitleBar.Fullscreen" white background, no title bar, full screen
  7. •android:theme="theme.black" background black
  8. •android:theme="Theme.Black.NoTitleBar" black background with no title bar
  9. •android:theme="Theme.Black.NoTitleBar.Fullscreen" black background, no title bar, fullscreen
  10. •android:theme="Theme.wallpaper" with system desktop for application background
  11. •android:theme="Theme.Wallpaper.NoTitleBar" uses the system desktop as the application background with no title bar
  12. •android:theme="Theme.Wallpaper.NoTitleBar.Fullscreen" with system desktop for application background, no title bar, fullscreen
  13. •android:theme="translucent" translucent
  14. •android:theme="Theme.Translucent.NoTitleBar" translucent, no title bar
  15. •android:theme="Theme.Translucent.NoTitleBar.Fullscreen" translucent, untitled bar, full screen
  16. •android:theme="Theme.panel"
  17. •android:theme="Theme.Light.Panel"


These topics can be applied to the entire application application scope or to an active activity range.

Application Application Range
The theme property is set in the application node in Androidmanifest.xml, and the theme theme applies to the entire application.
<application
android:icon= "@drawable/icon"
android:icon= "@string/app_name"
Android:icon= "@android: Style/theme.black.notitlebar" >

Active Activity Range
Use Java code or set the theme of the active activity in Androidmanifest.xml, which applies only to the current activity.
In the Androidmainifest.xml Setup method:
<activity
Android:name= ". About "
Android:label= "@string/app_name"
Android:theme= "@android: Style/theme.black.notitlebar" >

Use Java code to set it up in the oncreate of the currently active activity:
@Override
public void OnCreate (Bundle savedinstancestate) {
Super.oncreate (savedinstancestate);
SetTheme (Android. R.style.theme_translucent_notitlebar);
Setcontentview (R.layout.main);
}

Reference: http://blog.csdn.net/feng88724/article/details/6457431

Android App interface theme theme how to use

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.