On Thu, Oct 21, 2010 at 11:58 PM, Weeds <[email protected]> wrote:
> I'm wondering if it is possible to inflate a layout using a different
> density value than the default system density.
>
> I have a high density layout, which looks good on the Galaxy Tab
> (1024x600px, hdpi) and I like to use the same layout on another tablet
> with the same pixel resolution but medium density. The mdpi layout
> which is used works on the device but the screen just looks really
> empty and I would prefer to scale things up.
>
> So is there a xml argument for scaling the layout, maybe something
> similar to Bitmap.Options.targetDensity.
> Or could this be done with a new LayoutInflater class?
>
> Thanks

Weeds,

You cannot scale layout.
I am not even sure what would that mean?
Layout is resolution independent anyway.

I think that you would you like for your UI elements to occupy bigger
or smaller proportion of the screen,
As you know, Android 'knows' the density of the platform it sits on
and this gets classified into 1 of 3 brackets.

Since your 2nd tablet has medium screen density, all you have to do,
is to provide a mdpi layout that reflects your desired UI sizes and
proportions.
In other words, simply go and modify your current mdpi layout to make
it 'less empty'.
And don't forget that images used in your layouts have to be scaled as
well in order to achieve the best results.

--
Daniel







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



-- 
Daniel Drozdzewski

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