[forms-devel] Scaling sizes (Fonts/Width/Height) of across devices

Michael Ridland rid00z at gmail.com
Fri Jun 17 03:40:03 UTC 2016


I'm wondering if something like this would work, as a user I would like to
be able to set a width/height/font that dynamically changes to look the
same on all devices.

<Label DynamicFontSize="8"  DynamicPadding="16" DynamicHeightRequest="20"

Does that make sense at all? There might be a better word than dynamic..
scaled..

Thanks

*Michael Ridland | Technical Director | Xamarin MVP*

XAM Consulting - Mobile Technology Specialists

www.xam-consulting.com

Blog: www.michaelridland.com



On Thu, Jun 16, 2016 at 3:22 AM, Jason Smith <jason.smith at xamarin.com>
wrote:

> As a side note, a better API would probably be
>
> double fontSize = Device.GetUnitFontSize (double size, MeasurementUnit
> unit); where MeasurementUnit is some enum that contains something like:
>
> ScaledPixels,
> ScreenPixels,
> Point
>
> On Wed, Jun 15, 2016 at 10:20 AM, Jason Smith <jason.smith at xamarin.com>
> wrote:
>
>> The best idea we have come up with is as follows:
>>
>> double fontSize = Device.GetPixelFontSize (double pixelSize);
>>
>> However this has some implementation issues around the fact that point
>> size doesn't always perfectly map to pixel size due to a bunch of tiny
>> factors. So a good solution would be do change FontSize from a double to a
>> FontSize struct which could be a double + unit combination, however this
>> would represent a breaking change we cannot take, so the above is the best
>> we got which appears to be quite misleading in some edge cases. This is the
>> reason we haven't done it so far.
>>
>> On Tue, Jun 14, 2016 at 6:25 PM, Michael Ridland <rid00z at gmail.com>
>> wrote:
>>
>>> Hi
>>>
>>> One limitation of Forms that I come up with in all projects is the
>>> limited ability to set sizes which scale based on platform density etc.
>>> I've been pondering some solutions I can put onto nuget, but that's the old
>>> way now Forms is open source.
>>>
>>> What idea's does the Forms team have for this and would you like any
>>> help to build this into core?
>>>
>>> Thanks
>>>
>>> *Michael Ridland | Technical Director | Xamarin MVP*
>>>
>>> XAM Consulting - Mobile Technology Specialists
>>>
>>> www.xam-consulting.com
>>>
>>> Blog: www.michaelridland.com
>>>
>>>
>>>
>>> _______________________________________________
>>> forms-devel mailing list
>>> forms-devel at lists.xamarin.com
>>> http://lists.ximian.com/mailman/listinfo/forms-devel
>>>
>>>
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.ximian.com/pipermail/forms-devel/attachments/20160617/03070ec7/attachment.html>


More information about the forms-devel mailing list