Created
July 1, 2020 08:06
-
-
Save jsuarezruiz/9dee001a91209f26006e5f5da795b57e to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<ContentPage.Resources> | |
<ResourceDictionary> | |
<Style x:Key="LRTStyle" TargetType="Label"> | |
<Setter Property="AbsoluteLayout.LayoutBounds" Value="0, 0, 100, 100" /> | |
</Style> | |
<Style x:Key="RTLTStyle" TargetType="Label"> | |
<Setter Property="AbsoluteLayout.LayoutBounds" Value="0, 1, 100, 100" /> | |
</Style> | |
</ResourceDictionary> | |
</ContentPage.Resources> | |
<AbsoluteLayout> | |
<Label | |
Text="Test Rectangle" | |
AbsoluteLayout.LayoutFlags="PositionProportional" | |
Style="{StaticResource LRTStyle}"> | |
<Label.Triggers> | |
<Trigger TargetType="Label" | |
Property="FlowDirection" | |
Value="RightToLeft"> | |
<Setter Property="Style" Value="{StaticResource RTLTStyle}" /> | |
</Trigger> | |
</Label.Triggers> | |
</Label> | |
</AbsoluteLayout> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi @jsuarezruiz Thank you. But, it won't work.
I need AbsoluteLayout.LayoutFlags="XProportional, YProportional"
That's why my style defined are as
<Rectangle x:Key="myCustomLayoutBounds" HeightRequest="22" WidthRequest="{x:Static AbsoluteLayout.AutoSize}" X="0" Y="0.5" />