我ContentPage
我嘗試設置與平臺相關的填充值的構造函數中:Device.OnPlatform棄用
Padding = new Thickness(5, Device.OnPlatform(20, 5, 5), 5, 5);
Visual Studio中強調Device.OnPlatform
當我將鼠標指針懸停在方法調用我得到以下警告:
Devide.OnPlatform(T,T,T)已過時:'使用 switch(RuntimePlatform)而不是'。
最初使用的代碼是從e-book發表在2016年我真的很驚訝這個平臺如何快速演變「與Xamarin.Forms書創建移動應用程序」!
不幸的是,我不知道如何使用警告提示的方式替換Device.OnPlatform
。
https://github.com/xamarin/Xamarin.Forms/pull/658 – SushiHangover