(以“<div id="examples_center"><!-- 页面标题 --><div class="title-hd">手势冲突</div><!-- 标题下子标题及简介,可有多个 --><div class="title-mi">功...”为内容创建页面) |
|||
第25行: | 第25行: | ||
NSInteger index = self.currentIndex - direction; | NSInteger index = self.currentIndex - direction; | ||
− | if (index >= 0 && index <= 2 && | + | if (index >= 0 && index <= 2 &&!self.scrollView.isDecelerating) |
{ | { | ||
CGFloat width = self.scrollView.frame.size.width * index; | CGFloat width = self.scrollView.frame.size.width * index; |
2022年1月21日 (五) 14:16的版本
手势冲突
功能场景
常用于APP中不同页面切换或者展示历史轨迹等场景。
Android
iOS
//mapopen-website-wiki.bj.bcebos.com/demos/AndroidVideos/手势冲突@android.mp4
1590746640|//mapopen-website-wiki.bj.bcebos.com/demos/newqrcodes/手势冲突@2xanidroid.png
扫码体验
使用产品
Android地图SDK|/index.php?title=androidsdk
>
控件与手势|/index.php?title=androidsdk/guide/interaction/gesture
下载源码
//mapopen-website-wiki.bj.bcebos.com/demos/BaiduMapSDKExample.zip
核心接口
类
接口
描述
TextureMapView
getMap()
获取地图控制器
ViewPager
onPageSelected(int position)
viewPage选中回调
ViewPager
canScroll(View v, boolean checkV, int dx, int x, int y)
用于判断viewPage页面是否可以切换
核心代码
1.判断viewPage是否可以切换
JAVA
protected boolean canScroll(View v, boolean checkV, int dx, int x, int y) { if (Math.abs(dx) > 30) { return super.canScroll(v, checkV, dx, x, y); } else { return true; } }
复制
深色
复制成功