9 patch pngs should solve you problem, if I understand your problem
correctly.

Kumar Bibek
http://techdroid.kbeanie.com
http://www.kbeanie.com



On Sun, Jan 9, 2011 at 3:51 PM, Pent <tas...@dinglisch.net> wrote:

> I have a similar problem, would be nice if there was a standard way to
> query the launcher for the widget dimensions for a particular cell
> width/height wouldn't it ?
>
> Pent
>
> On Jan 9, 12:38 am, Mark <android.eggenst...@googlemail.com> wrote:
> > I want to set the background of an appwidget at runtime with a
> > dynamically generated image (skin) (which must fill the entire space
> > of the widget).
> >
> > Approach 1:
> > Use an ImageView and remoteViews.setImageViewUri()
> > Problem:
> > For the image to fit and look properly I need to know the exact pixel
> > size of the widget and I have not found a way to do that.
> > The minWidth/Height of the widget does not help. The space taken by
> > the cells also varies from Android version to version e.g. comparing
> > 2.1 (480x678) with 2.3 (480x633) for 4x4 cells on WVGA. And this is
> > only the default Home app. LauncherPro, ADW etc. have different status
> > bar heights etc. Also the image get's really big which slows down the
> > system, lags, is prone to crashes in low mem situation.
> >
> > Approach 2:
> > Use a NinePatch image which adjusts to whatever size the widget has.
> > Problem:
> > I couldn't find a way to set a NinePatch image. This only works with
> > resources which are inside the apk. Not with dynamically created
> > files.
> >
> > Any suggestions would be welcome.
>
> --
> 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<android-developers%2bunsubscr...@googlegroups.com>
> For more options, visit this group at
> http://groups.google.com/group/android-developers?hl=en

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