The often overlooked Xamarin.forms scale property

Sometimes it is the simplest things that make me happy.  I was digging through some Xamarin.Forms code on Github when I noticed the use of the Scale property on a view and I thought to myself, “Does that do what I think it does?”

Sure enough, it does.  It will change the scale a view (control) to make it larger or smaller.  The default is 1.0, which is normal size.

I was facing a design issue, at least on iOS where I needed to use a Switch but the normal size made it really seem out of place:

image

I needed something a little more subtle.  After applying a Scale of  0.7, I ended up with this:

image

Which seems much more to size, given the circumstances of the control.

This is simulator work only at this point so I will really need to check it out on the real device to make sure that this scaling doesn’t cause usability issues.

Leave a Reply 6 comments