When you read about standard widget sizes, that's in "dp" units: device
independent pixels. On a high-res screen, your layouts are scaled by Android
to a larger pixel size (a factor of 1.5 for hdpi).

As for your issue with scaling - did you add support for scaling in the
manifest? You can do it by either by setting minSdk to 4 and above, or by
including a <supports-screens> element.

--
Kostya Vasilyev -- http://kmansoft.wordpress.com
27.11.2010 0:45 пользователь "Hendrik Greving" <[email protected]>
написал:
> I'm much further now, thanks. I have 5 button in a horizontal linear
layout.
> Each button is currently 167x280. I read that a one row widget is normally

> 320x100. However, if I scale each button to 64x100, it looks bad, probably

> because I need the density?! On a high density screen like a Nexus one,the

> 167x280 look perfect. The other problem I have is, that it scales badly. I

> would like to at least make it look 'ok' when used on a tablet. However,
it
> looks like that it scales only the width, and doesn't preserve the ratio.
> I've tried a lot with different scale types, I've also tried 9-patch png
> images. If I do the latter, the button is scaled wrong in either case. Any

> idea? Thanks!!
>
> ----- Original Message -----
> From: "Mark Murphy" <[email protected]>
> To: <[email protected]>
> Sent: Saturday, November 20, 2010 4:16 AM
> Subject: Re: [android-developers] Re: custom view in widget
>
>
>> On Fri, Nov 19, 2010 at 6:19 PM, Hendrik Greving <[email protected]>
>> wrote:
>>> So basically the widget can only use stuff from the OS?
>>
>> Please read the documentation:
>>
>> http://developer.android.com/guide/topics/appwidgets/index.html
>>
>> particularly:
>>
>>
http://developer.android.com/guide/topics/appwidgets/index.html#CreatingLayout
>>
>> where it lists the eligible classes for use through a RemoteViews.
>>
>>> Let's say you want
>>> to draw something nice into a widget, I saw several widgets doing that,
>>> like
>>> HTML content or so, or a picture from your mum (j/k), how would you do
>>> that?
>>
>> Since you neglected to point out any examples, and since it is
>> impossible to tell by looking at a set of pixels whether or not they
>> came from "HTML content or so", it is difficult to answer your
>> question.
>>
>> TextView supports SpannedString, such as that returned by
>> Html.fromHtml(). RemoteViews supports sending a SpannedString to an
>> app widget. Hence, you can use that subset of HTML supported by
>> fromHtml() in a TextView hosted by an app widget.
>>
>> Also, please bear in mind that home screens are not subject to app
>> widget limitations. So, just because you might see an HTC Sense or
>> MOTOBLUR home screen doing something fancy does not mean that an app
>> widget is capable of the same feats of derring-do.
>>
>> --
>> Mark Murphy (a Commons Guy)
>> http://commonsware.com | http://github.com/commonsguy
>> http://commonsware.com/blog | http://twitter.com/commonsguy
>>
>> _The Busy Coder's Guide to Android Development_ Version 3.2 Available!
>>
>> --
>> 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]<android-developers%[email protected]>
>> 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 [email protected]
> To unsubscribe from this group, send email to
> [email protected]<android-developers%[email protected]>
> 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 [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