我使用以下语法来确定Xamarin表单内容页中的属性设置:
FontSize="{OnPlatform Android=64,iOS=32}“
它是工作的,但我必须重新安装Visual Studio。重新安装后,使用此标记的每个内容页面现在都显示错误: XLS0517无效属性路径语法。
有趣的是,只有当值为数字(int、double等)时才会发生这种情况。如果我把一个字符串值放在单引号内,错误就会消失。但是,32的字符串将不适用于HeightRequest。
发布于 2021-05-03 03:17:35
谢谢伙计..。这对我来说很有用
来自:Margin="{OnPlatform Android='0,0,15,0', iOS='0'}"
收件人:Margin="{OnPlatform UWP= '*', Android='0,0,15,0', iOS='0'}"
发布于 2021-03-08 09:54:25
有关更多详细信息,请参阅ms docs和下面的示例:
<ContentPage xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
....>
<StackLayout>
<Label Text="test" FontSize="{x:OnPlatform iOS='14', Android='12'}" />
</StackLayout>
</ContentPage>发布于 2021-04-08 22:27:24
我已经通过在元素上添加UWP='*‘解决了这个问题。
https://stackoverflow.com/questions/66519851
复制相似问题