移至Android Design Support v23后,TabLayout样式无法解析@ dimen / tab_max_width

时间:2015-08-20 04:08:54

标签: android android-design-library androiddesignsupport

转移到Android Design Support v23.0.0后,Android Studio无法构建一个使用Android Design Support v22.2.1构建的项目:

找不到与给定名称匹配的资源('tabMaxWidth',值为'@ dimen / tab_max_width')。

发生了什么事?

1 个答案:

答案 0 :(得分:19)

简而言之:您可能只需要将'design_'添加到这些值中。

很高兴你问,英俊。 v23.0.0改变了一堆值,这是v22.2.1中的旧值:

<color name="error_color">#FFDD2C00</color>
<color name="fab_stroke_end_inner_color">#0A000000</color>
<color name="fab_stroke_end_outer_color">#0F000000</color>
<color name="fab_stroke_top_inner_color">#1AFFFFFF</color>
<color name="fab_stroke_top_outer_color">#2EFFFFFF</color>
<color name="shadow_end_color">@android:color/transparent</color>
<color name="shadow_mid_color">#14000000</color>
<color name="shadow_start_color">#44000000</color>
<color name="snackbar_background_color">#323232</color>
<dimen name="appbar_elevation">4dp</dimen>
<dimen name="fab_border_width">0.5dp</dimen>
<dimen name="fab_content_size">24dp</dimen>
<dimen name="fab_elevation">8dp</dimen>
<dimen name="fab_size_mini">40dp</dimen>
<dimen name="fab_size_normal">56dp</dimen>
<dimen name="fab_translation_z_pressed">6dp</dimen>
<dimen name="navigation_elevation">12dp</dimen>
<dimen name="navigation_icon_padding">32dp</dimen>
<dimen name="navigation_icon_size">24dp</dimen>
<dimen name="navigation_max_width">320dp</dimen>
<dimen name="navigation_padding_bottom">8dp</dimen>
<dimen name="navigation_padding_top_default">0dp</dimen>
<dimen name="navigation_separator_vertical_padding">8dp</dimen>
<dimen name="snackbar_action_inline_max_width">128dp</dimen>
<dimen name="snackbar_background_corner_radius">0dp</dimen>
<dimen name="snackbar_elevation">2dp</dimen>
<dimen name="snackbar_extra_spacing_horizontal">0dp</dimen>
<dimen name="snackbar_max_width">-1px</dimen>
<dimen name="snackbar_min_width">-1px</dimen>
<dimen name="snackbar_padding_horizontal">12dp</dimen>
<dimen name="snackbar_padding_vertical">14dp</dimen>
<dimen name="snackbar_padding_vertical_2lines">24dp</dimen>
<dimen name="snackbar_text_size">14sp</dimen>
<dimen name="tab_max_width">264dp</dimen>
<dimen name="tab_min_width">72dp</dimen>
<integer name="snackbar_text_max_lines">2</integer>

现在是v23.0.0的新版本:

<color name="design_fab_shadow_end_color">@android:color/transparent</color>
<color name="design_fab_shadow_mid_color">#14000000</color>
<color name="design_fab_shadow_start_color">#44000000</color>
<color name="design_fab_stroke_end_inner_color">#0A000000</color>
<color name="design_fab_stroke_end_outer_color">#0F000000</color>
<color name="design_fab_stroke_top_inner_color">#1AFFFFFF</color>
<color name="design_fab_stroke_top_outer_color">#2EFFFFFF</color>
<color name="design_snackbar_background_color">#323232</color>
<color name="design_textinput_error_color">#FFDD2C00</color>
<dimen name="design_appbar_elevation">4dp</dimen>
<dimen name="design_fab_border_width">0.5dp</dimen>
<dimen name="design_fab_content_size">24dp</dimen>
<dimen name="design_fab_elevation">6dp</dimen>
<dimen name="design_fab_size_mini">40dp</dimen>
<dimen name="design_fab_size_normal">56dp</dimen>
<dimen name="design_fab_translation_z_pressed">6dp</dimen>
<dimen name="design_navigation_elevation">16dp</dimen>
<dimen name="design_navigation_icon_padding">32dp</dimen>
<dimen name="design_navigation_icon_size">24dp</dimen>
<dimen name="design_navigation_max_width">320dp</dimen>
<dimen name="design_navigation_padding_bottom">8dp</dimen>
<dimen name="design_navigation_padding_top_default">0dp</dimen>
<dimen name="design_navigation_separator_vertical_padding">8dp</dimen>
<dimen name="design_snackbar_action_inline_max_width">128dp</dimen>
<dimen name="design_snackbar_background_corner_radius">0dp</dimen>
<dimen name="design_snackbar_elevation">6dp</dimen>
<dimen name="design_snackbar_extra_spacing_horizontal">0dp</dimen>
<dimen name="design_snackbar_max_width">-1px</dimen>
<dimen name="design_snackbar_min_width">-1px</dimen>
<dimen name="design_snackbar_padding_horizontal">12dp</dimen>
<dimen name="design_snackbar_padding_vertical">14dp</dimen>
<dimen name="design_snackbar_padding_vertical_2lines">24dp</dimen>
<dimen name="design_snackbar_text_size">14sp</dimen>
<dimen name="design_tab_max_width">264dp</dimen>
<dimen name="design_tab_min_width">72dp</dimen>
<integer name="design_snackbar_text_max_lines">2</integer>