有没有办法镜像标签xamarin?

时间:2020-01-15 22:59:30

标签: c# xaml xamarin xamarin.forms

<ContentPage xmlns="http://xamarin.com/schemas/2014/forms"
         xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
         xmlns:d="http://xamarin.com/schemas/2014/forms/design"
         xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
         mc:Ignorable="d"
         x:Class="Counter.Page1">
<ContentPage.Content>
    <StackLayout BackgroundColor="White" Padding="60" VerticalOptions="Center">

        <Label Text="{Binding MainPageEditorText}" />

        <VisualStateManager.VisualStateGroups>
            <VisualStateGroup x:Name="CommonStates">
                <VisualState x:Name="Normal">
                    <VisualState.Setters>
                        <Setter Property="Scale"
                        Value="1" />
                    </VisualState.Setters>
                </VisualState>

                <VisualState x:Name="Pressed">
                    <VisualState.Setters>
                        <Setter Property="Scale"
                        Value="0.99" />
                    </VisualState.Setters>
                </VisualState>

            </VisualStateGroup>
        </VisualStateManager.VisualStateGroups>
    </StackLayout>
</ContentPage.Content>

是否可以完全镜像标签,而不仅仅是反转文本。我正在构建一个需要能够从iPad屏幕投影的应用程序,因此需要对其进行镜像。

1 个答案:

答案 0 :(得分:1)

我可能无法完全理解您的镜像含义;但是如果它类似于图像镜像,就像在镜子里看着自己;然后您就需要旋转或翻转。该代码将指导您。

   <StackLayout Margin="20">
                <Label Text="No Rotation"/>
                <Image Source="Assets/ten8ba4rcfqm.png"/>
                <Label Text="RotationX 180"/>
                <Image Source="Assets/ten8ba4rcfqm.png" RotationX="180"/>
                <Label Text="RotationY 180"/>
                <Image Source="Assets/ten8ba4rcfqm.png" RotationY="180"/>
    </StackLayout>

enter image description here