我在我的项目中有30个图像,我想在单个图像视图中使用下一个和上一个按钮(如幻灯片放映)显示其中的10个图像,我该怎么做?谢谢!在List
,然后:(R.drawable.xxx如):显示下一个或上一个图像onClick Android
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));
}
首先清除您的问题。 – 2014-11-21 11:02:09
http://www.androidhive.info/2013/09/android-fullscreen-image-slider-with-swipe-and-pinch-zoom-gestures/ – 2014-11-21 11:05:07