我已经使用Xamarin.Forms中的oxyplot成功生成了一个情节,但是我无法阻止整个页面的氧气图.
我在旋转木马的其他页面上使用stacklayout,并且在每个页面上都有一个横幅作为嵌入式stacklayout,并且希望将绘图显示在下面的嵌入式stacklayout中.
但横幅短暂出现,然后由氧气图写过.
我发现引用Grid应该使用Grid而不是stacklayout,因为存在已知问题,但网格也不起作用.
任何帮助感激不尽!这可能是一个约束性问题,例如,如果我删除Model ="{Binding Model}"它仍然有效!它忽略了HeightRequest ="100"而只是填充页面.我显然在这里遗漏了一些东西.
这是xaml代码,我已经注释掉了网格尝试,"oxy:PlotView"中的各种选项是我尝试的最后一个:
<?xml version="1.0" encoding="utf-8" ?>
<ContentPage
xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
x:Class="RentGuru2.PieCosts"
xmlns:oxy="clr-namespace:OxyPlot.Xamarin.Forms;assembly=OxyPlot.Xamarin.Forms"
Padding="0, 20, 0, 0"
BackgroundColor="#21b09c">
<StackLayout Orientation="Vertical">
<StackLayout Orientation="Horizontal" BackgroundColor="#21b09c" HeightRequest="60">
<Image Source = "BannerLogo.png" />
<Label Text="Costs breakdown" FontSize="Large" TextColor="White" Margin="10" VerticalTextAlignment="Center"/>
</StackLayout>
<StackLayout HeightRequest="300">
<oxy:PlotView Model="{Binding Model}" VerticalOptions="Center" HorizontalOptions="FillAndExpand"
HeightRequest="100" WidthRequest="100" />
</StackLayout>
</StackLayout>
<!--<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*" />
<ColumnDefinition Width="5*" />
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="60" />
<RowDefinition Height="*" />
</Grid.RowDefinitions>
<Image Grid.Row="0" Grid.Column ="0" Source = "BannerLogo.png" />
<Label …Run Code Online (Sandbox Code Playgroud)