How can I specify the default style of my widget

by Meryl Silverburgh » Fri, 13 Feb 2009 08:16:16 GMT

Sponsored Links

I create my own widget with its own drawable for background.

So in my styles.xml file, I have this:
      <style name="MyWidget">
        <item name="android:background">@drawable/btn_mywidget_bg</item>

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.


Other Threads

1. There is mtdblock0,1,2 partitions but I can't see mtdblock0,1,2 under the /dev.


Should I use /dev/block/mtdblock2 instead of /dev/mtdblock2?
I can see the /dev/block/mtdblock2.


2. ListView Scroll in the touch mode ?

Hi all , i'm rearranging items in the list by dragging the item. I'm
in the touch mode and want to scroll view couple of items  then i'm on
the last/first visiblePosition. Since i'm in the touch mode
setSelection is useless. How i can scroll  a list in the touch mode.
For drag i'm using onTouchEvent , onLayout to change background for
the current item + some stuff in adapter to make a swap.

3. Google provide updated internal apps for cupcake?

4. Call vs Voice plan App Idea! SOMEONE MAKE IT :D:D PLEASE

5. ******New Model Android Phone for sale******

6. Blog: A Brief History of the Android App Store Race

7. Google: We need to know how paid app transactions will work!