2

I'm very new (second day!) to android and working my way through the dev guide. There, it says that you can reference attributes inside the current theme from your XML by using the form "?...", for example

<?xml version="1.0" encoding="utf-8"?> <EditText id="text" xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="fill_parent" android:textColor="?android:textDisabledColor" android:text="@string/hello_world" /> 

If I try to build this, I just get "No resource found that matches the given name (at 'textColor' with value '?android:textDisabledColor')

Given that this seems pretty basic stuff, and yet I can't find any references to similar problems elsewhere, I must be missing something obvious or misunderstanding something simple. Can anyone tell me what it is?

2 Answers 2

2

I don't think textDisabledColor exists anymore - at least not in the newer SDKs which is probably why it can't be found. Try textColorSecondary instead - e.g.

android:textColor="?android:attr/android:textColorSecondary"

Unfortunately I cant figure out if theres a specific disabled color. I came across the site below which seems to define the default theme: See this link for definition of default theme

Sign up to request clarification or add additional context in comments.

Comments

0

try android:textColor="?android:attr/textDisabledColor"

1 Comment

That's still not working, I'm afraid. To let you know where I was starting from with this, it's the basic Hello, Android application in the dev guide.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.