Android图片拖拽缩放+左右滑动

Passing a Fragment in the constructor of an Adapter

ViewPager是android-support-v4.jar包中的一个系统控件,继承自ViewGroup,专门用以实现左右滑动切换View的效果,使用时需要首先在Project->properties->Java Build Path->Libraries->Add External Jars中加入sdk目录下的extras/android/support/v4/android-support-v4.jar(如果找不到,则需要用sdk manager下载android support package)。加入这个jar包之后就可以使用ViewPager类了。

ViewPager的使用类似于ListView,需要有对应的Adapter进行数据绑定,实现图片切换仅需要继承PaperAdapter就可以了。继承后需要重写如下四个方法:

instantiateItem(ViewGroup, int) //得到每个View
destroyItem(ViewGroup, int, Object) //用以控制当某个View不需要的时候的回收处理
getCount()
isViewFromObject(View, Object) //判断View和Object是否为同一个View

android图片缩放,拖拽

【Android】图片的浏览、缩放、拖动和自动居中

Android Matrix基础+详解

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

生活在西班牙

自己动手丰衣足食

BlueAsteroid

Just another WordPress.com site

Jing's Blog

Just another WordPress.com site

Start from here......

我的心情魔方

天才遠私廚

希望能做一個分享各種資訊的好地方

语义噪声

西瓜大丸子汤的博客

笑对人生,傲立寰宇

Just another WordPress.com site

Where On Earth Is Waldo?

A Project By Melanie Coles

the Serious Computer Vision Blog

A blog about computer vision and serious stuff

Cauthy's Blog

paper review...

Cornell Computer Vision Seminar Blog

Blog for CS 7670 - Special Topics in Computer Vision

datarazzi

Life through nerd-colored glasses

Luciana Haill

Brainwaves Augmenting Consciousness

槑烎

1,2,∞

Dr Paul Tennent

and the university of nottingham

turn off the lights, please

A bunch of random, thinned and stateless thoughts around the Web

%d bloggers like this: