OnPlatform to set VerticalTextAlignment

dinobdinob USUniversity ✭✭✭
edited June 10 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

Answers

  • JohnHardmanJohnHardman GBUniversity mod

    @dinob - Did that work?

  • dinobdinob USUniversity ✭✭✭
    edited June 11

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

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

    @JohnHardman Thanks, that was very helpful :)

Sign In or Register to comment.