Xamarin Forms: TranslateY (or other properties) for platform

microsoft xamarin heros c# iOS Android UWP

Sometimes you need to change a value for a specific platform and this value is a Double, for example. I spent a couple of minutes to find a working code.

<Label>
    <Label.TranslationY>
        <OnPlatform x:TypeArguments="x:Double" Android="-10" />
    </Label.TranslationY>
</Label>

Happy coding!

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.