Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3315548
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T22:21:47+00:00 2026-05-17T22:21:47+00:00

I am teaching myself Android using Eclipse, the Android plug-in, and Sams Teach Yourself

  • 0

I am teaching myself Android using Eclipse, the Android plug-in, and Sams “Teach Yourself Android Development” book. I have this weird little problem. I’ve been able to create xml files in the res/values directory that hold strings and color values (colors.xml and strings.xml). I have been able to reference these values in the properties of my Android screens (the xml in res/layout), for example setting the “Text” and “Text color” properties with references like “@string/topTitle” and “@color/titleColor,” where topTitle and titleColor are defined in the xml files.

BUT: when I create a file called “dimens.xml” and have font sizes in it, Eclipse correctly puts this file in res/values, but when I try to reference these values, e.g. “@dimension/titleFont” I get an error “No resource found that matches the given name.” I’ve tried lots of different names, I’ve tried “@dimens” instead of the type, still nothing. If I go into the layout xml file and set it explicitly to a font size, e.g. 22pt, it works.

So Eclipse recognized my “dimens.xml” file when I made it well enough to put it in res/values, and lets me edit it, and shows it full of (dimension) values. It just doesn’t recognize my referring to it in other xml files.

The book I’m using doesn’t actually show a dimension example so I must be doing something wrong. I checked the Android docs but couldn’t see any problem.

Any help appreciated. Thanks.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-17T22:21:48+00:00Added an answer on May 17, 2026 at 10:21 pm

    The correct way to refer to a dimension variable (stored in your dimens.xml (don’t think the name here really matters though, it’s what’s inside that does)) from another xml file is like this:

    "@dimen/nameOfVariable"
    

    Notice that it is neither dimension, dimensions or dimens, but dimen!

    If you look inside your xml file where you have your values, this will make sense as dimen is the name of the xml elements storing dimension values:

    <?xml version="1.0" encoding="utf-8"?>
    <resources xmlns:android="http://schemas.android.com/apk/res/android">
        <dimen name="someDimension">5dp</dimen>
        <dimen name="anotherDimension">10dp</dimen>
    </resources>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am currently teaching myself about various data strutures and am a little frustrated
I'm teaching myself Objective-C from a book ( Cocoa programming for mac OS X
Im teaching myself java and the book i'm looking at just got around to
I have been teaching myself JS and Jquery primarily for GM scripts (im not
I'm teaching myself Objective-C as a guilty pleasure, if you would. I have a
I am teaching myself some Python and I have come across a problem which
Teaching myself some c# and my problem is that I have a class which
I'm teaching myself Python and my most recent lesson was that Python is not
So I'm teaching myself Python, and I'm having an issue with lists. I want
I've been teaching myself Objective-C over the past month or so (I'm a Java

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.