Ok I think I may understand the problem but leads me down a very
frustrating path.  I think that if I were to set a style on a view,
that style would need to inherit the default style and then override
the values that I want to have custom.  That's fine and all, but I
have no idea where this magic list of default styles is or what the
values are in it.

I have scoured the developer's documentation starting here -
http://developer.android.com/guide/topics/ui/themes.html and can not
find this information anywhere.

Basically, I have no idea what style to extend and I can't find the
resources I need to figure it out.  I don't even know what the default
theme is.  Does anyone?

On Jun 3, 12:19 pm, Robert Green <rbgrn....@gmail.com> wrote:
> 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 android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to