我已经设法做到了这一点,一个小的负利润黑客。
这是代码:
<?xml version="1.0" encoding="utf-8" ?>
<ContentPage
x:Class="XfLabelRotationApp.MainPage"
xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml">
<Grid ColumnDefinitions="auto, *" ColumnSpacing="0">
<Grid
Grid.Column="0"
ColumnDefinitions="*,auto"
ColumnSpacing="0">
<StackLayout
Grid.Column="0"
Padding="10"
Spacing="10">
<BoxView
BackgroundColor="DarkBlue"
HeightRequest="30"
WidthRequest="30" />
<BoxView
BackgroundColor="DarkBlue"
HeightRequest="30"
WidthRequest="30" />
<BoxView
BackgroundColor="DarkBlue"
HeightRequest="30"
WidthRequest="30" />
<BoxView
BackgroundColor="DarkBlue"
HeightRequest="30"
WidthRequest="30" />
</StackLayout>
<Grid
Grid.Column="1"
BackgroundColor="#ddd"
WidthRequest="30">
<Label
Margin="-100,0"
Rotation="90"
Text="Open Detail By Dragging This"
VerticalTextAlignment="Center" />
</Grid>
</Grid>
<StackLayout
Grid.Column="1"
Padding="10"
BackgroundColor="#eee">
<Label Text="Main App Content" />
</StackLayout>
</Grid>
</ContentPage>
请注意
Margin="-100,0"
在
Label
。如果没有,标签只会假设
Height
的
Width
Rotation
财产似乎在Xamarin.Forms工作。
希望这能有所帮助。