在imageview-android中滑动以更改图像
我的应用程序中有一个imageview,我想在向左/向右滑动时显示下一个/上一个图像。我在这里找到了一个教程,但不知道如何实现它。任何帮助都将不胜感激在imageview-android中滑动以更改图像,android,imageview,Android,Imageview,我的应用程序中有一个imageview,我想在向左/向右滑动时显示下一个/上一个图像。我在这里找到了一个教程,但不知道如何实现它。任何帮助都将不胜感激 package com.example.androidhive; import android.app.Activity; import android.content.Intent; import android.os.Bundle; import android.widget.ImageView; public class FullIm
package com.example.androidhive;
import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.widget.ImageView;
public class FullImageActivity extends Activity {
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.full_image);
// get intent data
Intent i = getIntent();
// Selected image id
int position = i.getExtras().getInt("id");
ImageAdapter imageAdapter = new ImageAdapter(this);
ImageView imageView = (ImageView) findViewById(R.id.full_image_view);
imageView.setImageResource(imageAdapter.mThumbIds[position]);
}
}
你可以用两种方式。杰克·沃顿的查看寻呼机指示器 或者也可以使用Page curl向左或向右滑动
简单,改用ViewPager。从这里开始: