質問編集履歴

8

文章を追加しました。

2017/11/09 02:58

投稿

退会済みユーザー
test CHANGED
File without changes
test CHANGED
@@ -1,6 +1,8 @@
1
1
  お世話になります。
2
2
 
3
3
  8行目・10行目の drawable.color_linkのcolor_linkが赤字になり、setBackgroundDrawable()とgetDrawable()に取り消し線が表示されます。
4
+
5
+ もしかして、color_linkの方に問題があるのかも。。。?
4
6
 
5
7
 
6
8
 
@@ -128,7 +130,61 @@
128
130
 
129
131
  ```
130
132
 
133
+ color_link
131
134
 
135
+ ```ここに言語を入力
136
+
137
+ <?xml version="1.0" encoding="utf-8" ?>
138
+
139
+
140
+
141
+ <selector xmlns:android="http://schemas.android.com/apk/res/android">
142
+
143
+ <item android:state_pressed="true">
144
+
145
+ <shape android:shape="rectangle">
146
+
147
+ <gradient android:startColor="#660000"
148
+
149
+ android:endColor="#CC0066"
150
+
151
+ android:angle="90" />
152
+
153
+ <corners android:bottomRightRadius="3dp"
154
+
155
+ android:bottomLeftRadius="3dp" android:topLeftRadius="3dp"
156
+
157
+ android:topRightRadius="3dp" />
158
+
159
+ <stroke android:width="2px" android:color="#666666" />
160
+
161
+ </shape>
162
+
163
+ </item>
164
+
165
+ <item android:state_pressed="false">
166
+
167
+ <shape android:shape="rectangle">
168
+
169
+ <gradient android:startColor="#111111" android:endColor="#333333"
170
+
171
+ android:angle="90" />
172
+
173
+ <corners android:bottomRightRadius="3dp"
174
+
175
+ android:bottomLeftRadius="3dp" android:topLeftRadius="3dp"
176
+
177
+ android:topRightRadius="3dp" />
178
+
179
+ <stroke android:width="2px" android:color="#666666" />
180
+
181
+ </shape>
182
+
183
+ </item>
184
+
185
+ </selector>
186
+
187
+ ```
132
188
 
133
189
  >あと、33行目の R.drawable.set_iconも赤字になります。
134
190
 

7

文章を変えました。あとタイトルも変えました。

2017/11/09 02:58

投稿

退会済みユーザー
test CHANGED
@@ -1 +1 @@
1
- drawableにアクセスしたい。
1
+ ボタンにsetBackgroundDrawaableとgetDrawableの代わりなるように変更したい。
test CHANGED
@@ -1,6 +1,8 @@
1
1
  お世話になります。
2
2
 
3
3
  8行目・10行目の drawable.color_linkのcolor_linkが赤字になり、setBackgroundDrawable()とgetDrawable()に取り消し線が表示されます。
4
+
5
+
4
6
 
5
7
  あと、33行目の R.drawable.set_iconも赤字になります。
6
8
 
@@ -54,11 +56,11 @@
54
56
 
55
57
  Button sendBtn = (Button) findViewById(R.id.sendButton);
56
58
 
57
- saveBtn.setBackgroundDrawable(getResources().getDrawable(
59
+ ココ→saveBtn.setBackgroundDrawable(getResources().getDrawable(
58
60
 
59
61
  drawable.color_link));
60
62
 
61
- sendBtn.setBackgroundDrawable(getResources().getDrawable(
63
+ ココ→sendBtn.setBackgroundDrawable(getResources().getDrawable(
62
64
 
63
65
  drawable.color_link));
64
66
 

6

解決策の一種

2017/11/09 02:36

投稿

退会済みユーザー
test CHANGED
File without changes
test CHANGED
@@ -125,3 +125,9 @@
125
125
  }
126
126
 
127
127
  ```
128
+
129
+
130
+
131
+ >あと、33行目の R.drawable.set_iconも赤字になります。
132
+
133
+ drawableの部分をmipmapに変えたらエラーが消えました。

5

追加修正をしました。

2017/11/08 05:57

投稿

退会済みユーザー
test CHANGED
File without changes
test CHANGED
@@ -7,6 +7,24 @@
7
7
  いろいろと例えば下のようなものなどを調べて試してみましたが、駄目でした。https://teratail.com/questions/11124
8
8
 
9
9
  試しに、デバッグをしてみたら
10
+
11
+ Error:(111, 45) エラー: シンボルを見つけられません
12
+
13
+ シンボル: 変数 drawable
14
+
15
+ 場所: クラス MainActivity
16
+
17
+ エラー: シンボルを見つけられません
18
+
19
+ シンボル: 変数 drawable
20
+
21
+ 場所: クラス MainActivity
22
+
23
+ エラー: シンボルを見つけられません
24
+
25
+ シンボル: 変数 set_icon
26
+
27
+ 場所: クラス drawable
10
28
 
11
29
  エラー: シンボルを見つけられません
12
30
 

4

誤字修正

2017/11/08 05:18

投稿

退会済みユーザー
test CHANGED
File without changes
test CHANGED
@@ -16,7 +16,7 @@
16
16
 
17
17
  Error:Execution failed for task ':app:compileDebugJavaWithJavac'.
18
18
 
19
- > Compilation failed; see the compiler error output for details.
19
+ Compilation failed; see the compiler error output for details.
20
20
 
21
21
  と出ます。
22
22
 

3

誤字の修正をしました。

2017/11/08 05:16

投稿

退会済みユーザー
test CHANGED
File without changes
test CHANGED
@@ -14,13 +14,11 @@
14
14
 
15
15
  場所: クラス MainActivity
16
16
 
17
- と出ます。
18
-
19
17
  Error:Execution failed for task ':app:compileDebugJavaWithJavac'.
20
18
 
21
19
  > Compilation failed; see the compiler error output for details.
22
20
 
23
-
21
+ と出ます。
24
22
 
25
23
 
26
24
 

2

文法の追加をしました。

2017/11/08 05:15

投稿

退会済みユーザー
test CHANGED
File without changes
test CHANGED
@@ -15,6 +15,10 @@
15
15
  場所: クラス MainActivity
16
16
 
17
17
  と出ます。
18
+
19
+ Error:Execution failed for task ':app:compileDebugJavaWithJavac'.
20
+
21
+ > Compilation failed; see the compiler error output for details.
18
22
 
19
23
 
20
24
 

1

文法修正しました。

2017/11/08 05:15

投稿

退会済みユーザー
test CHANGED
File without changes
test CHANGED
@@ -1,3 +1,5 @@
1
+ お世話になります。
2
+
1
3
  8行目・10行目の drawable.color_linkのcolor_linkが赤字になり、setBackgroundDrawable()とgetDrawable()に取り消し線が表示されます。
2
4
 
3
5
  あと、33行目の R.drawable.set_iconも赤字になります。