I finally decided to use styles and themes instead of tediously
setting attributes for each individual view.  I was able to get the
style to work when I set it on android:textAppearance, but when I try
to just set it right on the style attribute like below, it no longer
applies.  This is happening to me for Buttons as well as TextViews.
What I want is to be able to have a few different styles for text
views and buttons and then just set the style on each button or text
view.  The style will need to define textSize, textColor, background
and maybe a few others.  Since background and some other things are
not textAppearance, I need to use the general style attribute.

Here's my current attempt:

In one of my menu layouts, I have a title, which looks like this:

        <TextView android:layout_width="wrap_content"
                android:layout_height="wrap_content" android:text="@string/
title_1_text"
                android:layout_gravity="center_horizontal" 
android:id="@+id/title"
                android:layout_marginBottom="20px" 
android:layout_marginTop="10px"
                style="@style/MenuTitle"></TextView>

then in res/values/styles.xml

<?xml version="1.0" encoding="utf-8"?>
<resources>
        <style name="MenuTitle">
                <item name="android:textSize">16pt</item>
                <item name="android:textColor">#FFF</item>
        </style>
</resources>


Any ideas on what I'm doing wrong here?  I would think that the style
attribute being set to the MenuTitle style would then apply the
android:textSize and android:textColor, but I appear to be missing
something.

I have no themes defined yet.  I'm considering doing that once I get
this working because all of the layout backgrounds and button styles
in my app will be the same.

Thanks for any help!

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to