【问题标题】:Difference between Appcompat.Widget and Widget.AppCompat in appcompat-v7 resources file?appcompat-v7 资源文件中 Appcompat.Widget 和 Widget.AppCompat 的区别?
【发布时间】:2015-07-24 16:48:38
【问题描述】:

appcompat-v7:22.2.0 中,values.xml 中声明的两个资源层次结构让我感到困惑。

例如,在同一文件中找到以下样式:values.xml in appcompat-v7:22.2.0

<!-- From: file:/usr/local/google/buildbot/repo_clients/https___googleplex-android.googlesource.com_a_platform_manifest.git/lmp-mr1-supportlib-release/frameworks/support/v7/appcompat/res/values/styles.xml -->

<style name="TextAppearance.AppCompat.Widget.ActionBar.Title" 
parent="Base.TextAppearance.AppCompat.Widget.ActionBar.Title"/>

<style name="TextAppearance.Widget.AppCompat.Toolbar.Title" 
parent="Base.TextAppearance.Widget.AppCompat.Toolbar.Title"/>

【问题讨论】:

    标签: android material-design android-resources android-styles


    【解决方案1】:

    实际上没有区别。

    来自line 323 of styles_base.xml

    <style name="Base.TextAppearance.Widget.AppCompat.Toolbar.Title"
           parent="TextAppearance.AppCompat.Widget.ActionBar.Title">
    </style>
    

    Toolbar.Title 基本样式只是ActionBar.Title 样式的别名。我假设 Google 是这样组织的,因为他们试图在我们的词汇表中用“工具栏”这个词替换“操作栏”这个词,但想让这些样式更容易找到。

    Appcompat.Widget 和 Widget.AppCompat 两者的资源层次有什么区别?

    有人刚刚决定以不同的方式命名它们。由于两种样式都有一个明确的父级,因此默认情况下它们都不会继承任何属性。我的猜测是这只是一个错误。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2013-08-18
      • 2014-12-30
      • 1970-01-01
      • 2017-06-15
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多