我有簡單的佈局與ImageView的滑翔無法加載圖像
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/activity_main"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context="com.example.vbusovikov.glidetest.MainActivity">
<ImageView
android:id="@+id/image"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
/>
</RelativeLayout>
而簡單滑翔表達將圖像加載到這個ImageView的只是爲了測試滑翔
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
ImageView imageView = (ImageView)findViewById(R.id.image);
Glide.with(this)
.load("http://you-ps.ru/uploads/posts/2013-08/1376601606_1273.png")
.error(R.mipmap.ic_launcher)
.into(imageView);
}
然而,示出了錯誤圖標。 它可能是什麼樣的問題? 我在我的網絡上有代理服務器,並且適合這種情況的gradle.properties。
systemProp.http.proxyHost=proxy******.ru
systemProp.http.proxyPort=****
但即使我嘗試在任何代理之外啓動這個小應用程序,但由於某種原因它將不起作用。
我的build.gradle文件
apply plugin: 'com.android.application'
android {
compileSdkVersion 25
buildToolsVersion "25.0.2"
defaultConfig {
applicationId "com.example.vbusovikov.glidetest"
minSdkVersion 15
targetSdkVersion 25
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
compile 'com.android.support:appcompat-v7:25.1.1'
compile 'com.github.bumptech.glide:glide:3.7.0'
testCompile 'junit:junit:4.12'
}
UPD。這個簡單的應用程序可以從互聯網上載入圖片,但無法從我的服務器載入圖片。我的服務器的一些圖片加載正常,但其他人沒有。我失去了我的side..check網絡這個已經
'嘗試在任何代理之外啓動這個小應用程序,它不會因爲某種原因而工作,請嘗試更改圖像。它工作與否? –
'Glide.with(yourclass.this)' –
http://stackoverflow.com/questions/36384789/glide-not-loading-real-image-and-stuck-with-placeholder –