您的位置:首页 > 移动开发 > Android开发

android图片全景360°自动(手动)循环滚动

2015-01-28 17:57 351 查看
一个自定义控件:


地址

github:https://github.com/guoGavin/PanoramicAutoScroll

csdn:http://download.csdn.net/detail/jiguangcanhen/8404891


效果图





功能

按照一定的速度自动滚动。
当手指进行操作则停止滚动,手指放开则继续滚动。
可以设置为无限循环滚动或者无限往复滚动。
可以设置滚动速度。


Layout

<com.gavin.panoramicautoscroll.AutoScrollHorizontalScrollView
android:id="@+id/scrollView"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:scrollbars="none"
android:background="@android:color/transparent" >

<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal" />

</com.gavin.panoramicautoscroll.AutoScrollHorizontalScrollView>



滚动方式

enum ShowWay{
cycle,//Infinite scrolling
repeat,//Scroll back and forth
}



自动滚动速度

enum Speed{
slow,
medium,
fast,
}



设置以及启动

autoScrollView.setShowContent(bitmap);
autoScrollView.setSpeed(speedResult);
autoScrollView.setShowWay(showWayResult);
autoScrollView.startAutoScroll();
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: