Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

No resource found that matches the given name (at 'paddingBottom' with value '@dimen/ activity_vertical_margin')

Tags:

android

I was trying to build a navigation drawer for which I copied code from some website and I am getting this error in one of the XMLs.

No resource found that matches the given name (at 'paddingBottom' with value '@dimen/ activity_vertical_margin')

How to get rid of this error?

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:paddingBottom="@dimen/activity_vertical_margin"
    android:paddingLeft="@dimen/activity_horizontal_margin"
    android:paddingRight="@dimen/activity_horizontal_margin"
    android:paddingTop="@dimen/activity_vertical_margin"
    tools:context=".TabbedActivity$DummySectionFragment" >

    <TextView
        android:id="@+id/section_label"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content" />

</RelativeLayout>
like image 612
Aditya Sharma Avatar asked Dec 08 '22 05:12

Aditya Sharma


2 Answers

  1. Go to Android view of the project
  2. go to app -> res -> values.
  3. Right click on values
  4. Then "New" (right at the top of the pop-up menu), "Value resource file".
  5. In the "file name" space, type "dimens.xml" (without the quotation marks " ")
  6. Then simply "Ok".

Click on the newly created "dimens.xml" file. Remove all code in it and paste the following:

<?xml version="1.0" encoding="utf-8"?>
<resources>
    <dimen name="activity_vertical_margin">8dp</dimen>
    <dimen name="activity_horizontal_margin">8dp</dimen>
</resources>

that's should work

like image 126
Muh Amed Avatar answered Dec 11 '22 10:12

Muh Amed


Make sure you copied the dimens.xml file too.

like image 24
issathink Avatar answered Dec 11 '22 10:12

issathink