Click here to Skip to main content
15,885,216 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Java
android:paddingBottom="@dimen/activity_vertical_margin"
   android:paddingLeft="@dimen/activity_horizontal_margin"
   android:paddingRight="@dimen/activity_horizontal_margin"
   android:paddingTop="@dimen/activity_vertical_margin"


these 4 line give error ! whay ?
Posted
Updated 28-Jun-18 21:32pm
Comments
[no name] 17-Aug-14 7:53am    
Probably because you did not define those values in your resources.

You need to declare activity_vertical_margin in the res / values / dimens.xml.

Ex:
<dimen name="activity_vertical_margin">5dp</dimen>
 
Share this answer
 
activity_main.xml

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent"
android:orientation="vertical"
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">


soluation below


dimean.xml

<?xml version="1.0" encoding="utf-8"?>
<resources>
<dimen name="activity_horizontal_margin">5dp
<dimen name="activity_vertical_margin">5dp
 
Share this answer
 
This worked for me, go to android studio, click on res then right click on values then click on *New* then click on *value resource file* and name it dimens then click finish. After which you paste the below code

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

</resources>
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900