zoukankan      html  css  js  c++  java
  • android 中theme.xml与style.xml的区别

    from://http://liangoogle.iteye.com/blog/1848448

    android 中theme.xml与style.xml的区别:

    相同点:

    两者的定义相同。

    1. <resources>
    2. <stylename="theme"parent="android:Theme.Black">
    3. <itemname="android:windowNoTitle">true< /item>
    4. <itemname="android:textSize">14sp< /item>
    5. <itemname="android:textColor">#FFFF0000< /item>
    6. < /style>
    7. < /resources>

    不同点:

    一、使用的地方不同

            1.theme.xml:对整个应用或某个Activity存在全局性影响。

                        AndroidManifest.xml中:

                        <application android:theme="@android:style/theme">,

                        <activity android:theme="@android:style/theme">,

                       application 和  activity  java中:setTheme(R.style.theme);  

             2 style.xml:用在单独的View。

                     <EditText android:layout_height="wrap_content"

                       android:text="EditText"

                       style="@style/Title"

                       android:layout_width="fill_parent"

                       android:id="@+id/editText1"></EditText>

    二、 在R.attr定义中以window开头的一些属性只对theme有效。

    三、如果一个应用使用了theme,同时应用下的view也使用了style,那么当theme与样式style发生冲突时,style的优先级高于主题。

  • 相关阅读:
    09Socket编程
    一个平时写程序通用的Makefile样例
    08socket编程
    07socket编程
    06socket编程
    01TCP/IP基础
    25管道
    jQuery,CSS:offset()方法,CSS scrollTop属性
    jQuery:length属性:是jQuery对象对应元素在document中的个数,返回值数据类型是Number
    JS正则表达式
  • 原文地址:https://www.cnblogs.com/wanqieddy/p/3706203.html
Copyright © 2011-2022 走看看