【发布时间】:2020-02-05 09:59:22
【问题描述】:
我正在使用 Xamarin.Forms 进行编程。我想知道如何在 XAML 中使用OnPlatform 仅设置单个平台的高度请求?如果不引用平台,我想保留默认值-1。
我目前有以下代码:
<ListView.HeightRequest>
<OnPlatform x:TypeArguments="x:Double">
<On Platform="WPF" Value="153" />
<On Platform="Android" Value="-1" />
<On Platform="iOS" Value="-1" />
<On Platform="UWP" Value="-1" />
</OnPlatform>
</ListView.HeightRequest>
我希望我只需要写这样的东西:
<ListView.HeightRequest>
<OnPlatform x:TypeArguments="x:Double">
<On Platform="WPF" Value="153" />
</OnPlatform>
</ListView.HeightRequest>
这不行,有可能吗?
【问题讨论】:
标签: xaml xamarin xamarin.forms