Error in android xml page

Asked

Viewed 632 times

1

I am very beginner on android and strictly following the example provided by my teacher and using a College PC I copied and pasted and had no problems, using my notebook I’m with the following error:

Error:(1) No Resource found that Matches the Given name (at paddingLeft with value@dimen/activity_horizontal_margin').

The xml statement 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 error happens to other paddings. How can I fix ?

  • Remove these paddings that is no problem.

1 answer

3


He is giving this message because he did not find the information requested in android:paddingLeft="@dimen/activity_horizontal_margin", inside the archive 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>

File location within directory:

inserir a descrição da imagem aqui

Browser other questions tagged

You are not signed in. Login or sign up in order to post.