Image is not loaded from URL to Mvx.MvxImageView
Asked Answered
C

1

7

I'm making a GridView that's suppose to view images with text. The images are taken from url's and my problem is that they're not loaded.

Inside a grid item template I have this element:

<Mvx.MvxImageView
    android:id="@+id/gridItemImage"
    android:layout_width="fill_parent"
    android:layout_height="25dp"
    android:layout_alignParentLeft="true"
    android:layout_alignParentRight="true"
    android:scaleType="fitXY"
    local:MvxBind="ImageUrl Image" />

The property that ImageUrl is bound too looks like this:

public string Image
{
    get
    {
        return @"http://some.image/on/the/Internet.png";
    }
}

It actually calls a private field, but I've written the test value I'm setting.

My question is: What should I do to properly bind ImageUrl and get it to show in the grid?

Cutright answered 28/4, 2016 at 14:28 Comment(0)
S
10

What Plugins do you have installed?

Have you installed DownloadCache, File and JSON plugins on both the Core and Droid project?

Update

To properly bind to the ImageUrl of a MvxImageView you have to: have the Mvvmcross DownloadCache, File and JSON plugins on both the Core and Droid project.

These are the plugins you need: enter image description here

Swelling answered 28/4, 2016 at 14:49 Comment(8)
This does not provide an answer to the question. To critique or request clarification from an author, leave a comment below their post. - From ReviewRibbonwood
Sorry I have updated my answer, assuming the author had missed out in the plugins.Swelling
Yes, I did missed out the plugins. I'm fairly new to MVVMCross :-) We managed to implement the plugin, and it works now. Thanks, Iain :-)Cutright
No worries, glad to helpSwelling
I didn't have to install the plugins on the core project. and it worked for me. But installing the plugins on the droid project definitely helped.Facelift
@IainSmith, I really appreciate your (all who works on MvvmCross) work, and I believe it's really cool framework, and I just love using it, but you (we) have to do something with documentation! That's just a nightmare! For so many years! To find out how to use the MvxImageView I have to search for answers like "MvxImageView" not working. There is also a Stuart's video regarding the loader, but there are no (at least, easy accessible) details of how to use it in Android Views design, for instance.Maxinemaxiskirt
@Maxinemaxiskirt I agree Xamarin is not so bad idea. But working with Visual Studio on Mac is a real nightmare! Especially when you have and app with >20 screens. I have to say I'd implement it faster as a native app.Frederic
@Micer, you are not quite following the article. The topic about is about MvvmCross framework in particular. Xamarin still is as it is, which is kind of irrelevant to native apps comparison.Maxinemaxiskirt

© 2022 - 2024 — McMap. All rights reserved.