Kostyra,

Thanks for trying to help.

The problem turned out to be that the image has an alpha channel
(transparency) that is simply way bigger than I'd like.  After trying a
number of things, I found that a 'zealous autocrop' resized the image
but kept some transparency around the edges.  As a 9-patch the
background resizes quite nicely as needed.

Thanks.

...Jake


>>>>> "KV" == Kostya Vasilyev <[email protected]> writes:

   KV> The file is a nine-patch, and should fill the view
   KV> automatically. And I'm sorry to say, it does that just fine for
   KV> all my widgets.

   KV> If you think the issue is with this particular file, you could
   KV> try testing with one of the nine-patches under
   KV> <android-sdk-root>\platforms\android-X\data\res.

   KV> Other than that, you could try completely cleaning the project in
   KV> Eclipse and/or uninstalling the application with "adb uninstall"
   KV> just to make sure nothing is interfering with your testing.

   KV> -- Kostya
   KV> 2011/6/20 Jake Colman <[email protected]>

   >> 
   >> Kostya,
   >> 
   >> The background is specified in XML exactly as you suggested.  When I
   >> click and hold on the widget to drag it, Android's outline box is larger
   >> than the widget itself.  If I write code to invoke setBackgroundColor()
   >> in lieu of setbackgroundresource() the color fills in a larger square
   >> than does the background resource.  Doesn't all that indicate that there
   >> is something about the PNG file, itself, that needs to be changed to
   >> make it appear larger?
   >> 
   >> ...Jake
   >> 
   >> >>>>> "KV" == Kostya Vasilyev <[email protected]> writes:
   >> 
   KV> I just dropped the image into my project, and set it as an
   KV> android:background for a layout (activity, not wiget).
   >> 
   KV> It worked fine.
   >> 
   KV> It's a good sign that your widget is getting filled with color -
   KV> perhaps there is something unusual about how you set the
   KV> background?
   >> 
   KV> I would try the simplest thing possible - set it with
   KV> android:background and remove any code that might touch that.
   >> 
   KV> -- Kostya
   >> 
   KV> 2011/6/20 Jake Colman <[email protected]>
   >> 
   >> >>
   >> >> Using some new preference settings in my widget, the user can
   >> completely
   >> >> replace the background image with a color.  When I do that, the
   >> painted
   >> >> area is quite a bit larger than the area covered when I use the
   >> >> background image.  I think that is the equivalent of what you asked me
   >> >> to check, correct?
   >> >>
   >> >> ...Jake
   >> >>
   >> >>
   >> >> >>>>> "KV" == Kostya Vasilyev <[email protected]> writes:
   >> >>
   KV> It looks fine, and enlarges properly in draw9patch.  Are you
   KV> certain the layout where it's used as the background actually
   KV> gets larger width and / or height?
   >> >>
   KV> Try setting android:background="#FF008040" or some such to check.
   >> >>
   KV> -- Kostya
   >> >>
   KV> 2011/6/20 Nikolay Elenkov <[email protected]>
   >> >>
   >> 
   KV> --
   KV> You received this message because you are subscribed to the Google
   KV> Groups "Android Developers" group.
   KV> To post to this group, send email to
   >> [email protected]
   KV> To unsubscribe from this group, send email to
   KV> [email protected]
   KV> For more options, visit this group at
   KV> http://groups.google.com/group/android-developers?hl=en
   >> 
   >> --
   >> Jake Colman -- Android Tinkerer
   >> 
   >> --
   >> 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
   >> 

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

-- 
Jake Colman -- Android Tinkerer

-- 
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