对于 UWP,我需要为Grid
. 此外,平板电脑和智能手机上的值应该不同。
以下代码使应用程序崩溃
<ColumnDefinition>
<ColumnDefinition.Width>
<OnIdiom.Phone>
<OnPlatform x:TypeArguments="GridLength" iOS="*" Android="*" WinPhone="100" />
</OnIdiom.Phone>
<OnIdiom.Tablet>
<OnPlatform x:TypeArguments="GridLength" iOS="*" Android="*" WinPhone="200" />
</OnIdiom.Tablet>
</ColumnDefinition.Width>
</ColumnDefinition>
和
在 xmlns http://xamarin.com/schemas/2014/forms中找不到类型 OnIdiom.Phone
代码在一个ViewCell
. 所以我不能使用额外的ResourceDictionary
,也OnSizeAllocated()
不能在文件后面的代码中使用。
可以OnIdiom
和OnPlatform
一起使用吗?