Error in the xml page of android

1

I'm very new to android and following strictly the example provided by my teacher and using a PC of the Faculty I copied and pasted and had no problems, using my notebook I have the following error:

  

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

The xml declaration looks like this:

<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:paddingLeft="@dimen/activity_horizontal_margin"
    android:paddingRight="@dimen/activity_horizontal_margin"
    android:paddingTop="@dimen/activity_vertical_margin"
    android:paddingBottom="@dimen/activity_vertical_margin" tools:context=".MainActivity">

The same mistake happens to other paddings. How can I resolve?

    
asked by anonymous 18.04.2017 / 22:39

1 answer

2

He is giving this message because he did not find the requested information in android:paddingLeft="@dimen/activity_horizontal_margin" , inside the file res/values/dimens.xml you can define this information.

Ex:

<resources>
    <!-- Default screen margins, per the Android Design guidelines. -->
    <dimen name="activity_horizontal_margin">16dp</dimen>
    <dimen name="activity_vertical_margin">16dp</dimen>
</resources>

Location of the file within the directory:

    
19.04.2017 / 02:20