Finding all available styles defined by android platform themes

前端 未结 4 852
盖世英雄少女心
盖世英雄少女心 2020-12-22 17:47

In several android styling tutorials parent style elements are used that i can not find in the android.R.style.* styles (http://developer.android.com/reference/android/R.sty

4条回答
  •  南方客
    南方客 (楼主)
    2020-12-22 18:06

    As stated in the "Applying Styles and Themes" article:

    The Android platform provides a large collection of styles and themes that you can use in your applications. You can find a reference of all available styles in the R.style class. To use the styles listed here, replace all underscores in the style name with a period. For example, you can apply the Theme_NoTitleBar theme with "@android:style/Theme.NoTitleBar".

    The R.style reference, however, is not well documented and does not thoroughly describe the styles, so viewing the actual source code for these styles and themes will give you a better understanding of what style properties each one provides. For a better reference to the Android styles and themes, see the following source code:

    • Android Styles (styles.xml)
    • Android Themes (themes.xml)

    These files will help you learn through example. For instance, in the Android themes source code, you'll find a declaration for