對於UWP,我需要在Grid
中的列寬度不同的大小。此外,平板電腦和智能手機的價值應該不同。是否可以在XAML(Xamarin.Forms)中混合使用OnIdiom和OnPlatform?
下面的代碼崩潰該應用
<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>
與
類型OnIdiom.Phone中的xmlns http://xamarin.com/schemas/2014/forms
該代碼是在ViewCell
未找到。所以我不能使用額外的ResourceDictionary
,OnSizeAllocated()
在代碼隱藏文件中不可用。
是否可以同時使用OnIdiom
和OnPlatform
?這在代碼工作
我試圖在本地機器上運行應用程序。這裏200寬度不被尊重。它不應該落入「平板電腦」類別嗎? – testing
'Device.OS'是'Windows','Device.Idiom'是'Desktop'。 XAML中是否有可用的定義? 'WinPhone'之前工作正常。 – testing
支持OnIdiom中的'Desktop'幾天前登陸https://github.com/xamarin/Xamarin.Forms/pull/420。該修補程序將出現在即將到來的2.3.4-pre1中 –