zoukankan      html  css  js  c++  java
  • Styles and Themes

    Styles and Themes

      A 样式 is a collection of properties that specify the look and format for a View or window. A style can specify properties such as height, padding, font color, font size, background color, and much more. A style is defined in an XML resource that is separate from the XML that specifies the layout.

      A theme is a style applied to an entire Activity or application, rather than an individual View (as in the example above). When a style is applied as a theme, every View in the Activity or application will apply each style property that it supports.

      To create a set of styles, save an XML file in the res/values/ directory of your project. The name of the XML file is arbitrary, but it must use the .xml extension and be saved in the res/values/ folder.

      The root node of the XML file must be <resources>.

      

      Each child of the <resources> element is converted into an application resource object at compile-time, which can be referenced by the value in the <style> element's name attribute. This example style can be referenced from an XML layout as @style/CodeFont

      If you want to inherit from styles that you've defined yourself, you do not have to use the parent attribute. Instead, just prefix the name of the style you want to inherit to the name of your new style, separated by a period. For example, to create a new style that inherits the CodeFont style defined above, but make the color red, you can author the new style like this:

      

    参考:http://www.android-doc.com/guide/topics/ui/themes.html

  • 相关阅读:
    总结
    ElasticSearch课件1.22
    clickhouse1.0.5
    大数据实时项目(ads层)
    大数据实时项目(dws层)1.2
    大数据实时项目(日活)1.6.1
    01_大数据技术之Spark入门(2.1)
    03_大数据技术之SparkSql(2.0)
    04_大数据技术之SparkStreaming(2.0)
    05_大数据技术之Spark内核解析(1.1)
  • 原文地址:https://www.cnblogs.com/tekkaman/p/6262514.html
Copyright © 2011-2022 走看看