XF 通过判断平台加载不同的图片
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Xamarin.Forms;
namespace App15
{
public partial class MainPage : ContentPage
{
public MainPage()
{
InitializeComponent();
string plf= Device.RuntimePlatform;
switch(plf)
{
case Device.iOS:
break;
case Device.Android:
myImage.Source = ImageSource.FromResource("App15.images.1.jpg");
break;
default:
myImage.Source = ImageSource.FromResource("App15.images.2.jpg");
break;
}
}
}
}