andoid gallery点击事件添加
程序员文章站
2022-05-22 17:40:09
...
gallery.setSpacing(30);
gallery.setUnselectedAlpha(0.5f);
gallery.setOnItemClickListener(new OnItemClickListener()
{
@Override
public void onItemClick(AdapterView<?> arg0, View arg1, int position, long arg3)
{
/*
* 单机事件添加 对应画廊图片的点击事件
*/
switch (position)
{
default:
Bundle instance = new Bundle();
instance.putIntArray("image_res", image_ids);
Intent intent = new Intent();
intent.setClass(ImageGallery.this, ViewFlipperActivity.class);
intent.addFlags(Intent.FLAG_ACTIVITY_BROUGHT_TO_FRONT);
intent.putExtras(instance);
startActivity(intent);
break;
}
}
});
gallery.setUnselectedAlpha(0.5f);
gallery.setOnItemClickListener(new OnItemClickListener()
{
@Override
public void onItemClick(AdapterView<?> arg0, View arg1, int position, long arg3)
{
/*
* 单机事件添加 对应画廊图片的点击事件
*/
switch (position)
{
default:
Bundle instance = new Bundle();
instance.putIntArray("image_res", image_ids);
Intent intent = new Intent();
intent.setClass(ImageGallery.this, ViewFlipperActivity.class);
intent.addFlags(Intent.FLAG_ACTIVITY_BROUGHT_TO_FRONT);
intent.putExtras(instance);
startActivity(intent);
break;
}
}
});
推荐阅读
-
Recyclerview添加头布局和尾布局、item点击事件详解
-
vue动态渲染svg、添加点击事件的实现
-
Android实现动态添加标签及其点击事件
-
Android自定义Notification添加点击事件
-
Vue在echarts tooltip中添加点击事件案例详解
-
vue 项目引入echarts 添加点击事件操作
-
点击 Button触发事件将GridView1 CheckBox勾选的行添加到GridView2中
-
Android TextView 给文本中指定片段添加自定义点击事件
-
Android TextView 给文本中指定片段添加自定义点击事件
-
jquery live方法,解决jquery动态添加按钮无法触发点击事件的问题