Code Bye

关于android的Theme和style的问题

 

最近在搞这一块,很纠结,求解。
1 . 先看这两个style,定义在themes.xml中:  
     <style name=”Theme.Wallpaper”>
         <item name=”android:windowBackground”>@android:color/transparent</item>
         <item name=”android:colorBackgroundCacheHint”>@null</item>
         <item name=”android:windowShowWallpaper”>true</item>
    </style>

     <style name=”Theme.Wallpaper.NoTitleBar”>
         <item name=”android:windowNoTitle”>true</item>
     </style>
这两个都没有父类,而且第二个也没有继承第一个,但从功能上看,第二个像是继承了第一个的所有属性。这个怎么解释?和命名的规则有关吗?google自动实现的?

2. 还是上面的问题,更广泛一点的,假设我自定义一个theme,比如 theme.holo.xxx    那么它会默认继承theme.holo吗?
    更进一步,自定义<style name=”Theme.xxx” parent=”Theme.Holo”>   , 然后我再定义 <style name=”Theme.xxx.yyy”> 它会默认继承Theme.xxx 吗?
   

求解脱。。。
没有人吗?自己顶。。。
自定义主题一般都会集成系统自带的然后改里面的东西啊,parent=“”才是继承,和命名没关系

40分
第二个继承自第一个。因为name的语法就是这样。参阅http://blog.csdn.net/mingli198611/article/details/7254275
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. 

CodeBye 版权所有丨如未注明 , 均为原创丨本网站采用BY-NC-SA协议进行授权 , 转载请注明关于android的Theme和style的问题