安卓:怎样绘制使用循环若干时间的图像 [英] Android :How can i draw a image a number of time using for loop
本文介绍了安卓:怎样绘制使用循环若干时间的图像的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我在android系统工作。
I am working in android.
我有这两个图像: -
i have these two images:-
和
现在使用循环,我想在运行时绘制这些图像。所以请我,我怎么能这样做呢?
now using for loop i want to draw these image at run time. so please me how can i do this ?
意味着它会在运行时决定多少时间,这些图像应重复。
最后我要画这样的: -
means it will decided at run time that how many time these images should repeat. finally i want to draw like this:--
但这个比例可能会在运行更改。请帮助我,我怎么能做到这一点。你可以提供我一些例子来实现这一点。
谢谢你在前进。
but this ratio may change at run. please help me how can i do this. you may provide me some example to implement this. Thank you in advance.
推荐答案
使用水平的LinearLayout。
use a horizontal LinearLayout.
for (int i=0; i < menCount; i++) {
ImageView imageView = new ImageView(this);
imageView.setImageDrawable(arg0); //provide the drawable as argument.
hll.addView(imageView);
}
有关女性形象做同样的太..
do the same for female image too..
这篇关于安卓:怎样绘制使用循环若干时间的图像的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文