質問編集履歴
1
xmlファイル、graidleファイルの追記
title
CHANGED
|
File without changes
|
body
CHANGED
|
@@ -4,9 +4,9 @@
|
|
|
4
4
|
上記のURLを参考にしてみたのですが
|
|
5
5
|
|
|
6
6
|
```java
|
|
7
|
-
ImageView imageView = (ImageView) findViewById(R.id.
|
|
7
|
+
ImageView imageView = (ImageView) findViewById(R.id.droidimageid1);
|
|
8
8
|
GlideDrawableImageViewTarget target = new GlideDrawableImageViewTarget(imageView);
|
|
9
|
-
Glide.with(this).load(R.raw.
|
|
9
|
+
Glide.with(this).load(R.raw.droid1).into(target);
|
|
10
10
|
```
|
|
11
11
|
|
|
12
12
|
上記のコードの
|
|
@@ -20,4 +20,71 @@
|
|
|
20
20
|
|
|
21
21
|
おそらくGlideDrawableimageViewTargetとGlideを定義してない
|
|
22
22
|
というエラー文だと思うのですがどう定義するのか分かりません。
|
|
23
|
-
分かる方いましたらご教授お願いします。
|
|
23
|
+
分かる方いましたらご教授お願いします。
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
[追記]
|
|
27
|
+
```xmlファイル
|
|
28
|
+
|
|
29
|
+
<?xml version="1.0" encoding="utf-8"?>
|
|
30
|
+
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
|
31
|
+
xmlns:app="http://schemas.android.com/apk/res-auto"
|
|
32
|
+
xmlns:tools="http://schemas.android.com/tools"
|
|
33
|
+
android:layout_width="match_parent"
|
|
34
|
+
android:layout_height="match_parent"
|
|
35
|
+
tools:context=".DroidSlotActivity">
|
|
36
|
+
|
|
37
|
+
<ImageView
|
|
38
|
+
android:id="@+id/droidimageid1"
|
|
39
|
+
android:layout_width="70dp"
|
|
40
|
+
android:layout_height="70dp"
|
|
41
|
+
android:layout_marginTop="100dp"
|
|
42
|
+
android:layout_toLeftOf="@id/droidimageid2"
|
|
43
|
+
android:src="@drawable/m" />```
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
```build.gradle(:app)
|
|
47
|
+
|
|
48
|
+
plugins {
|
|
49
|
+
id 'com.android.application'
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
android {
|
|
53
|
+
compileSdkVersion 30
|
|
54
|
+
buildToolsVersion "30.0.2"
|
|
55
|
+
|
|
56
|
+
defaultConfig {
|
|
57
|
+
applicationId "sample.example.droidslot4"
|
|
58
|
+
minSdkVersion 19
|
|
59
|
+
targetSdkVersion 30
|
|
60
|
+
versionCode 1
|
|
61
|
+
versionName "1.0"
|
|
62
|
+
|
|
63
|
+
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
buildTypes {
|
|
67
|
+
release {
|
|
68
|
+
minifyEnabled false
|
|
69
|
+
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
compileOptions {
|
|
73
|
+
sourceCompatibility JavaVersion.VERSION_1_8
|
|
74
|
+
targetCompatibility JavaVersion.VERSION_1_8
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
dependencies {
|
|
79
|
+
|
|
80
|
+
implementation 'androidx.appcompat:appcompat:1.2.0'
|
|
81
|
+
implementation 'com.google.android.material:material:1.2.1'
|
|
82
|
+
implementation 'androidx.constraintlayout:constraintlayout:2.0.1'
|
|
83
|
+
testImplementation 'junit:junit:4.+'
|
|
84
|
+
androidTestImplementation 'androidx.test.ext:junit:1.1.2'
|
|
85
|
+
androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0'
|
|
86
|
+
implementation 'com.github.bumptech.glide:glide:4.11.0'
|
|
87
|
+
annotationProcessor 'com.github.bumptech.glide:compiler:4.11.0'
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
```
|