我知道在Android中不可能水平滚动网格视图.但我正在做的是在水平滚动视图中动态添加图像按钮,如下所示:
public class HorizontalScroller extends Activity {
static int l=0;
private Rect mTempRect = new Rect();
static int r1=0;
static int t=0;
static int b=0;
static int x=0;
static int y=0;
//Button[] b1 = new Button[100];
ImageButton btn[][] = new ImageButton[10][10];
//ImageButton b1 = new ImageButton(this);
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
LinearLayout rl = (LinearLayout)findViewById(R.id.widget92);
LinearLayout.LayoutParams params1 = new LinearLayout.LayoutParams(LayoutParams.WRAP_CONTENT,LayoutParams.WRAP_CONTENT);
for(int i=0;i<4;i++)
{
for(int j=0;j<10;j++)
{System.out.println("helo");
/* l=l+100; …Run Code Online (Sandbox Code Playgroud) 可能重复:
服务,异步任务和线程之间的区别?
我正在下载大约600张图片.我希望这个任务在后台运行,哪种方法是最好的方法.异步还是线程?有人可以告诉我吗?
我想制作一个应用程序,其中有一个加载文本,并在它们前面有一些点图像.我希望图像在一段时间后连续显示,直到后台工作完成,或者我可以在绝对布局的运行时更改图像视图的位置.请分享准确的运行代码,我需要它.