Image-Xamarin.Form

Image-Xamarin.Form,xamarin,xamarin.forms,Xamarin,Xamarin.forms,我已经实现了一个登录页面,现在我想添加一个标题图像;但是,图像不会显示在视图上 public LoginView () { InitializeComponent (); Title= "Login"; Content = new StackLayout { Spacing = 20, Padding = 50, VerticalOptions = Layo

我已经实现了一个登录页面,现在我想添加一个标题图像;但是,图像不会显示在视图上

    public LoginView ()
    {
        InitializeComponent ();

        Title= "Login";

        Content = new StackLayout {
            Spacing = 20,
            Padding = 50,
            VerticalOptions = LayoutOptions.Center,
            Children = {
                new Image {Source="headerImage.jpg"},
                (username = new Entry { Placeholder = "Username" }),
                (password = new Entry { Placeholder = "Password", IsPassword = true }),
                (button=new Button { Text = "Login", TextColor = Color.White, BackgroundColor = Color.FromHex ("77D065")})
            }
        };

        button.Clicked += Login;
    }

图像需要放在平台项目(iOS、Android等)中,而不是放在共享表单项目中。有关详细信息,请参阅


“图像可以通过Xamarin跨平台共享。表单可以专门为每个平台加载,也可以下载以供显示。”

你说得对,Jason。我从表单项目移动到iOS后,它就工作了,然后它抓取了图像。有意思。你好,杰森,你对以下问题有什么想法吗