这两种语法有什么区别?

时间:2017-09-06 05:24:31

标签: android android-layout android-styles

android:textAppearance="@android:style/TextAppearance.Small"
android:textAppearance="?android:textAppearanceSmall"

两者都给出了相同的结果。编译效率是否存在差异。

1 个答案:

答案 0 :(得分:1)

<div class="reserve-select">
  <input type="radio" name="option">
  <span class="placeholder">Choose...</span>

  <label class="option">
        <input type="radio" name="option">
        <span class="title">Speedometer</span>
      </label>
  <label class="option">
        <input type="radio" name="option">
        <span class="title">Fire</span>
      </label>
  <label class="option">
        <input type="radio" name="option">
        <span class="title">Badge</span>
      </label>
</div>

<div class="paragrafo">
  <p>Teste</p>
</div>

是直接的文字样式设置。

 android:textAppearance="@android:style/TextAppearance.Small"

是参考文本样式,它在此Activity或此TextView的主题上设置值。像这样:

android:textAppearance="?android:textAppearanceSmall"