在UI中应用风格style和主题theme



style---->定义View或window外观和格式的属性集合; is a collection of properties that specify the look and format for a View or window. 
theme---->定义整个activity或应用的一种style.----> is a style applied to an entire Activity or application, 


themes_device_defaults--修改本机默认themes,请不要修改themes.xml,会造成CTS无法通过; 
styles_device_default--修改本机默认styles,请不要修改styles.xml,会造成CTS无法通过; 

两种方式设置style: 

    1)对单个view来说,在layout布局中对view元素增加style属性即可. 
   2)对整个Activity 或者 application应用来说, 在Android manifest文件---> 或 元素中增加android:theme属性. 

一些styles属性智能应用在theme中,不能被应用到View视图中,这些属性通常应用到整个窗体window,而不能被用于任何一种视图view. 
比如,隐藏标题栏、隐藏状态栏、或改变窗体背景,这些style属性不属于任何view对象。 

这些只支持theme的属性名称在R.attr中以“window”开头,比如windowNoTitle 和 windowBackground  

你可能感兴趣的:(在UI中应用风格style和主题theme)