【发布时间】:2014-11-21 11:00:25
【问题描述】:
我的项目中有 30 张图像,我想使用下一个和上一个按钮(如幻灯片放映)在单个图像视图中显示其中的 10 个,我该怎么做?谢谢!
previousButton = (Button) findViewById(R.id.backButton);
previousButton.setOnClickListener(this);
nextButton = (Button) findViewById(R.id.nextButton);
nextButton.setOnClickListener(this);
set image in onclick method
@Override
public void onClick(View view) {
// TODO Auto-generated method stub
if (view == previousButton) {
--positionOfSelectedImage;
// set background image of
} else if (view == nextButton) {
++positionOfSelectedImage;
}
imageToBeSet.setImageURI(Uri.parse(absolutepathOfImage));
}
【问题讨论】:
-
先清除你的问题....