encontrar el estilo correcto en R.attr



I would like to style a TextView to look like the default style of the "summary" attribute within a PreferenceScreen.

using the styles from this official list, Yo he tratado "summary" y "summaryOn", but neither of them looks like the default style for summaries. Can anyone explain why, or suggest which one I should be using?

preguntado el 27 de agosto de 11 a las 16:08

creo que es @android:attr. No ?android:attr -

aqui stackoverflow.com/questions/3405161/… it says ?android:attr, but i tried with a @, but nothing changes -

2 Respuestas

There isn't a theme attribute that refers to the specific semantic of preference summary text, preferences use ?android:attr/textAppearanceSmall como se ilustra aquí: http://goo.gl/3yZmx (This is the layout file used by the Android framework for preference items.)

Respondido el 02 de Septiembre de 12 a las 08:09

Adam, the link you gave is broken now. Can you find it in the current source? - Jeff Axelrod

New link for the shortened link above: android.googlesource.com/platform/frameworks/base/+/… The short link in the answer has also been updated. - adamp

The correct way to reference an ID is using @.

Como @string/my_string

Since you wish to reference an ID defined by Android directly, try this:


Respondido 27 ago 11, 21:08

still no luck, it just shows large-ish sized text, with a black font. whereas, it should be (on my phone) a small-ish font, with the colour of light blue - 92Jacko

make sure it's not wrapped in another tag providing a format overriding it. read about style inheritance as well. try android:textStyle - CrackerJack9

92Jacko is trying to reference a theme attribute value, not a resource. For what he's trying to do his syntax is correct. ?android:attr/attributeName will use the value of the current theme's android:attributeName item. Think of the ?attr syntax like dereferencing a pointer. - adamp

have a documentation reference for the ?android:attr notation? IntelliJ's Android plugin team may like to know as well. - CrackerJack9

No es la respuesta que estás buscando? Examinar otras preguntas etiquetadas or haz tu propia pregunta.