是什么styles.xml和的themes.xml之间的差异 [英] What is difference among styles.xml and themes.xml

查看:546
本文介绍了是什么styles.xml和的themes.xml之间的差异的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想知道什么是之间的 styles.xml 的区别和的themes.xml ?对我来说,他们只是看起来一样对XML的格式相同。

May I know what is the difference between styles.xml and themes.xml? To me, they just look same as both XML are in the same format.

<style name="...
    <item name="...

所以,在我的应用程序,它提供的定制颜色,尺寸,绘制,......我两样都需要 styles.xml 的themes.xml 呢?我应该如何决定把哪些文件,其中的XML?

So, in my app which provide customization coloring, size, drawable, ... do I need both styles.xml and themes.xml as well? How should I decide which XML to put in which file?

推荐答案

走出的样式和主题的。你可能会寻找这一行。

Out of the whole page of the Styles and Themes. You may be looking for this line.

当您在布局样式应用于单一视图,属性   由样式定义仅适用于这一观点。如果风格   适用于ViewGroup中,子视图元素不会继承   样式属性只的元素,你直接应用   样式将应用其属性。但是,您可以应用样式等等   它适用于所有视图元素,通过应用风格为主题。

When you apply a style to a single View in the layout, the properties defined by the style are applied only to that View. If a style is applied to a ViewGroup, the child View elements will not inherit the style properties—only the element to which you directly apply the style will apply its properties. However, you can apply a style so that it applies to all View elements—by applying the style as a theme.

当你申请的主题,它的范围改变了一切,这取决于你把它应用在活动或应用程序。风格更本地。

When you apply as theme, it changes everything in scope, depending if you applied it on Activity or Application. Style is more 'local'.

这篇关于是什么styles.xml和的themes.xml之间的差异的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆