質問編集履歴

3

えrf

2016/11/21 04:02

投稿

earnest_gay
earnest_gay

スコア615

test CHANGED
File without changes
test CHANGED
@@ -159,3 +159,9 @@
159
159
 
160
160
 
161
161
  ```
162
+
163
+
164
+
165
+
166
+
167
+ [PHPに置き換えてみた。PHPがわかる方はこちらもみていただけると質問内容がわかりやすくなってます。](https://teratail.com/questions/55979)

2

フェr

2016/11/21 04:02

投稿

earnest_gay
earnest_gay

スコア615

test CHANGED
File without changes
test CHANGED
@@ -122,6 +122,24 @@
122
122
 
123
123
 
124
124
 
125
+ //こうならないといけない
126
+
127
+ //ImageView 表示させたい画像
128
+
129
+ // 1 1
130
+
131
+ // 2 2
132
+
133
+ // 3 何もしない
134
+
135
+ // 4 3(実質4番目の画像)
136
+
137
+
138
+
139
+
140
+
141
+
142
+
125
143
 
126
144
 
127
145
  //ImageViewの数だけ繰り返す

1

ウェf

2016/11/20 17:38

投稿

earnest_gay
earnest_gay

スコア615

test CHANGED
File without changes
test CHANGED
@@ -63,3 +63,81 @@
63
63
  //該当レコードを取得すべき処理はここで終わり
64
64
 
65
65
  ```
66
+
67
+
68
+
69
+
70
+
71
+
72
+
73
+ 追記:どういうロジックが必要でしょうか???
74
+
75
+
76
+
77
+ ```ここに言語を入力
78
+
79
+ //表示させるImageViewを取得
80
+
81
+ ImageView ImageViewMainImage = (ImageView) findViewById(R.id.ImageView_mainImage);
82
+
83
+ ImageView ImageViewSubImage1 = (ImageView) findViewById(R.id.ImageView_subImage1);
84
+
85
+ ImageView ImageViewSubImage2 = (ImageView) findViewById(R.id.ImageView_subImage2);
86
+
87
+ ImageView ImageViewSubImage3 = (ImageView) findViewById(R.id.ImageView_subImage3);
88
+
89
+
90
+
91
+ ArrayList<ImageView> imageViews = new ArrayList<>();
92
+
93
+ imageViews.add(ImageViewMainImage);
94
+
95
+ imageViews.add(ImageViewSubImage1);
96
+
97
+ imageViews.add(ImageViewSubImage2);
98
+
99
+ imageViews.add(ImageViewSubImage3);
100
+
101
+
102
+
103
+ System.out.println("テスト[" + new java.util.Date()+ "]:" + imageViews);
104
+
105
+
106
+
107
+
108
+
109
+
110
+
111
+ //3つ目のレコードがなかった場合4つ目のレコード画像が3つ目の配列としてget_bmpに入る
112
+
113
+ //ImageView 表示させたい画像
114
+
115
+ // 1 1
116
+
117
+ // 2 2
118
+
119
+ // 3 3(実質4番目の画像)
120
+
121
+ // 4
122
+
123
+
124
+
125
+
126
+
127
+ //ImageViewの数だけ繰り返す
128
+
129
+ for (int i = 0; i < imageViews.size(); i++) {
130
+
131
+
132
+
133
+ imageViews.get(i).setImageBitmap(get_bmp.get(i));
134
+
135
+ imageViews.get(i).setVisibility(View.VISIBLE);
136
+
137
+
138
+
139
+ }
140
+
141
+
142
+
143
+ ```