在升级到Android Design Support v23.0.0之后,Android Studio无法构建一个之前使用Android Design Support v22.2.1正常构建的项目:
没有找到与给定名称匹配的资源(在“tabMaxWidth”处的值为“@dimen/tab_max_width”)。
发生了什么?
在升级到Android Design Support v23.0.0之后,Android Studio无法构建一个之前使用Android Design Support v22.2.1正常构建的项目:
没有找到与给定名称匹配的资源(在“tabMaxWidth”处的值为“@dimen/tab_max_width”)。
发生了什么?
简而言之:你可能只需要在这些值前添加“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>