Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

No resource found that matches the given name (at 'layout_marginTop' with value '@dimen/abc_action_bar_icon_vertical_padding

In the appcompat_v7 in layout resources, shows me this error:

Error: No resource found that matches the given name (at 'layout_marginTop' with value '@dimen/abc_action_bar_icon_vertical_padding').

This line code shows me an error are this (for ImageView from abc_action_bar_home.xml):

android:layout_marginTop="@dimen/abc_action_bar_icon_vertical_padding"
android:layout_marginBottom="@dimen/abc_action_bar_icon_vertical_padding"

I found the solution by adding the word _material, like this:

"@dimen/abc_action_bar_icon_vertical_padding_material"

I found the solution here.

like image 963
Viviana Del Pilar López Avatar asked Jan 09 '15 15:01

Viviana Del Pilar López


1 Answers

The old action bar is now known as the app bar and is a kind of toolbar in Material Design that came with Android Lollipop. Many of the metrics have changed and thus so has the naming of many of the values in R.dimen.

So as you discovered

abc_action_bar_icon_vertical_padding

is now called

abc_action_bar_icon_vertical_padding_material.

As an extra, here is a graphic from the Android docs that shows some of the new default metrics:

enter image description here

Note that these defaults can change based on the device and orientation. For example,

Default height:

  • Mobile Landscape: 48dp
  • Mobile Portrait: 56dp
  • Tablet/Desktop: 64dp
like image 62
Suragch Avatar answered Oct 08 '22 19:10

Suragch



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!