PhotoView的簡單使用方法

photoview是android 圖片縮放開源組件

首先添加photoview的4個類包,在我資源裏面可以找到下載

http://download.csdn.net/detail/storm1314888/8524579



向ImagePageractivity.class傳入參數

protected void imageBrower(int position, ArrayList<String> urls2) {
Intent intent = new Intent(this, ImagePagerActivity.class);
// 圖片url,爲了演示這裏使用常量,一般從數據庫中或網絡中獲取
intent.putExtra(ImagePagerActivity.EXTRA_IMAGE_URLS, urls2);
intent.putExtra(ImagePagerActivity.EXTRA_IMAGE_INDEX, position);
startActivity(intent);
}


position是點擊圖片的位置,一般在點擊事件裏面獲取,urls2是所有圖片的url地址,相對地址即可。該函數在item的點擊事件中使用


發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章