And I have added this in my manifest file:
<application android:label="@string/app_name" android:theme="@style/MyTheme">
This in my themes.xml file:
<resources>
<style name="MyTheme">
<item name="buttonStyleMyWidget">@style/MyWidget</item>
</style>
</resources>
and this in my styles.xml file:
<?xml version="1.0" encoding="utf-8"?>
<resources>
<style name="MyWidget">
<item name="android:background">@drawable/btn_mywidget_bg</item>
</style>
</resources>
Can you please tell me what am I missing?
On Fri, Feb 13, 2009 at 2:38 PM, Meryl Silverburgh
<[email protected]> wrote:
> Thank you.
>
> I have added a 'themes.xml' file in my res/values directory.
>
> <resources>
> <style name="MyTheme">
> <item name="buttonStyleMyWidget">@style/MyWidget</item>
> </style>
> </resources>
>
> But how can I apply that "MyTheme" throughout my android application?
>
> Thank you.
>
>
>
>
>
>
> On Thu, Feb 12, 2009 at 4:59 PM, birds fly <[email protected]> wrote:
>> hi
>> you can use Theme , The theme can include all style information.
>>
>> <style name=string [parent=string] >
>> <item name=string></item>
>> </style>
>>
>>
>> On Fri, Feb 13, 2009 at 8:16 AM, Meryl Silverburgh
>> <[email protected]> wrote:
>>>
>>> Hi,
>>>
>>> I create my own widget with its own drawable for background.
>>>
>>> So in my styles.xml file, I have this:
>>> <resources>
>>> <style name="MyWidget">
>>> <item name="android:background">@drawable/btn_mywidget_bg</item>
>>> </style>
>>> </resources>
>>>
>>> In my main.xml, if i specified my 'style' attribute, my background
>>> drawable was displayed correctly.
>>> <test.MyWidget android:id="@+id/mywidget" style="@style/MyWidget" />
>>>
>>> but if I just do this:
>>> <test.MyWidget android:id="@+id/mywidget" /> , the background drawable
>>> is not display correctly.
>>>
>>> Can you please tell me how can I specify the default style of my
>>> widget so that I don't need to add style="@style/MyWidget" everytime I
>>> use my widget?
>>>
>>> Thank you.
>>>
>>>
>>
>>
>> >>
>>
>
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---