图像未在Xamarin.android应用程序

时间:2015-07-17 07:25:58

标签: xamarin imageview xamarin.android mvvmcross

我正在使用MvxImageView从服务器加载图像

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:local="http://schemas.android.com/apk/res-auto"
    android:orientation="vertical"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent">
    <TextView
        android:layout_width="161.9dp"
        android:layout_height="wrap_content"
        android:textSize="15dp"
        local:MvxBind="Text TextContent"
        android:layout_marginRight="0.0dp"
        android:scrollbars="vertical"
        android:overScrollMode="always"
        android:verticalScrollbarPosition="right"
        android:gravity="center_vertical"
        android:scrollbarAlwaysDrawVerticalTrack="true"
        android:scrollbarStyle="insideInset" />
    <LinearLayout
        android:id="@+id/shareLayout"
        android:layout_width="157.7dp"
        android:layout_height="wrap_content"
        android:gravity="right"
        android:orientation="vertical"
        android:layout_alignParentTop="true"
        android:layout_alignParentRight="true"
        android:layout_marginBottom="58.2dp"
        android:layout_marginLeft="0.0dp">
        <Mvx.MvxImageView
            android:layout_width="150dp"
            android:layout_height="150dp"
            android:layout_marginRight="8.3dp"
            android:layout_margin="10dp"
            local:MvxBind="ImageUrl ImageUrl"
            android:layout_marginLeft="48.1dp"
            android:paddingRight="10dp"
            android:minHeight="100dp"
            android:minWidth="100dp"
            android:layout_marginBottom="35.4dp" />
    </LinearLayout>
</RelativeLayout>

之前它工作正常,但现在没有加载图像。我没有改变任何事情。我曾尝试重新安装DownloadCache和File Plugin,但它没有用。我还设置了Internet访问权限,但它给出了以下错误。

mvx:诊断:465.84无法下载图像http://i.space.com/images/i/000/046/083/i02/gravity-probe-b.jpg:WebException:错误:ConnectFailure(连接超时) 07-17 10:14:53.784 I / mono-stdout(396):mvx:诊断:465.84无法下载图像http://i.space.com/images/i/000/046/083/i02/gravity-probe-b.jpg:WebException:错误:ConnectFailure(连接超时)       在System.Net.HttpWebRequest.EndGetResponse(IAsyncResult asyncResult)[0x00064] in:0 07-17 10:14:53.784 I / mono-stdout(396):在System.Net.HttpWebRequest.EndGetResponse(IAsyncResult asyncResult)[0x00064] in:0   在Cirrious.MvvmCross.Plugins.DownloadCache.MvxFileDownloadRequest.ProcessResponse(System.Net.WebRequest request,IAsyncResult result)[0x00017] in:0 07-17 10:14:53.784 I / mono-stdout(396):在Cirrious.MvvmCross.Plugins.DownloadCache.MvxFileDownloadRequest.ProcessResponse(System.Net.WebRequest request,IAsyncResult result)[0x00017] in:0 InnerException是SocketException:连接超时 07-17 10:14:53.794 I / mono-stdout(396):InnerException是SocketException:连接超时       在System.Net.Sockets.Socket.Connect(System.Net.EndPoint remoteEP)[0x000f7] in:0 07-17 10:14:53.794 I / mono-stdout(396):在System.Net.Sockets.Socket.Connect(System.Net.EndPoint remoteEP)[0x000f7]中:0   在System.Net.WebConnection.Connect(System.Net.HttpWebRequest请求)[0x0019b]中:0 [0:] mvx:诊断:465.84无法下载图像http://i.space.com/images/i/000/046/083/i02/gravity-probe-b.jpg:WebException:错误:ConnectFailure(连接超时)       在System.Net.HttpWebRequest.EndGetResponse(IAsyncResult asyncResult)[0x00064] in:0   在Cirrious.MvvmCross.Plugins.DownloadCache.MvxFileDownloadRequest.ProcessResponse(System.Net.WebRequest request,IAsyncResult result)[0x00017] in:0 InnerException是SocketException:连接超时       在System.Net.Sockets.Socket.Connect(System.Net.EndPoint remoteEP)[0x000f7] in:0   在System.Net.WebConnection.Connect(System.Net.HttpWebRequest请求)[0x0019b]中:0 07-17 10:14:53.794 I / mono-stdout(396):在System.Net.WebConnection.Connect(System.Net.HttpWebRequest request)[0x0019b]中

1 个答案:

答案 0 :(得分:0)

安装DownloadCache插件和MVVMCross文件插件以及MVVCross.Plugin.PictureChooser