OnPlatform to set VerticalTextAlignment

dinobdinob USUniversity ✭✭✭
edited June 2019 in Xamarin.Forms

How can I use OnPlatformto set VerticalTextAlignment in XAML based on platform?

For example, I want to have it set like this:

On Android and IOS: VerticalTextAlignment = Center
On UWP: VerticalTextAlignment = Start

Best Answer


  • JohnHardmanJohnHardman GBUniversity mod

    @dinob - Did that work?

  • dinobdinob USUniversity ✭✭✭
    edited June 2019

    @JohnHardman said:
    @dinob - Did that work?

    Thanks @JohnHardman . I havent had a chance to try it. I will try it today and provide an update. It is not for Label but for TabButton displayed in a ViewCell:

          <controls:TabButton Text="{Binding TabTitle}" 
            VerticalTextAlignment="Start" // I want this centered on Android and IOS but on Top for UWP
  • dinobdinob USUniversity ✭✭✭

    @JohnHardman Thanks, that was very helpful :)

Sign In or Register to comment.