我的布局中有一组10个图像。我给了他们顺序的ID也作为动态更改图像视图背景
android:id="@+id/pb1"
android:id="@+id/pb2"
现在我想动态改变背景。
int totalPoi = listOfPOI.size();
int currentPoi = (j/totalPoi)*10;
for (i=1;i<=currentPoi;i++) {
imageview.setBackgroundResource(R.drawable.progressgreen);
}
现在在for循环中,我想动态设置图像视图背景。如果currentpoi值为3,则应改变3个图像视图的背景。 for循环迭代了许多图像视图背景应该改变的时间。希望问题现在已经清楚。
注:我有一个需要被设置为10个的图像视图
只有1个图像progressgreen
你能展示完整的代码并清楚解释吗?你有多少可绘制的。列出可绘制的s。 –
你的问题又是什么? – Reno