全部服务产品
开发者频道
定价
登录

文档全面上新

更科技的视觉体验,更高效的页面结构,快前往体验吧!

体验新版
(撤销Lbsyun讨论)的版本18216)
 
第1行: 第1行:
<div id="examples_center"><!-- 页面标题 --><div class="title-hd">手势冲突</div><!-- 标题下子标题及简介,可有多个 --><div class="title-mi">功能场景</div><div class="wrap-mi">常用于APP中不同页面切换或者展示历史轨迹等场景。</div><!--  --></div><div class="demos_wrap"><div class="header"><div class="andiord-header active">Android</div><div class="ios-header">iOS</div></div><div class="andiord-wrap wrap"><div class="wrap-wp"><div class="wrap_left"><div class="left-video"><div class="img-bg-and"></div><div class="phone-android"><div class="video-wrap infor"><div class="video-control"></div><!-- 安卓视频位置 (不写协议)--><pre>//mapopen-website-wiki.cdn.bcebos.com/demos/AndroidVideos/shoushichongtu_2.wmv</pre>
+
<div id="examples_center"><!-- 页面标题 --><div class="title-hd">手势冲突</div><!-- 标题下子标题及简介,可有多个 --><div class="title-mi">功能场景</div><div class="wrap-mi">常用于APP中不同页面切换或者展示历史轨迹等场景。</div><!--  --></div><div class="demos_wrap"><div class="header"><div class="andiord-header active">Android</div><div class="ios-header">iOS</div></div><div class="andiord-wrap wrap"><div class="wrap-wp"><div class="wrap_left"><div class="left-video"><div class="img-bg-and"></div><div class="phone-android"><div class="video-wrap infor"><div class="video-control"></div><!-- 安卓视频位置 (不写协议)--><pre>//mapopen-website-wiki.bj.bcebos.com/demos/AndroidVideos/手势冲突@android.mp4</pre>
 
</div><div class="video-icon-and"><div class="play play-and"></div><div class="stop stop-and"></div></div></div><div class="progressWrap-hide-and"></div><div id="videoControls-and"><div id="progressWrap-and"><div id="playProgress-and"></div></div></div></div><div class="left-qrCode"><!-- 安卓二维码位置 --><div class="qrCode-and">1590746640|//mapopen-website-wiki.bj.bcebos.com/demos/newqrcodes/手势冲突@2xanidroid.png</div><div>扫码体验</div></div></div><div class="wrap_right"><div class="wrap_right_nav"><div class="wrap_right_nav_l"><div>使用产品</div><div><!-- 安卓使用产品下选项,可有多个 --><div class="documentA">Android地图SDK|/index.php?title=androidsdk</div><div>></div><div class="documentA">控件与手势|/index.php?title=androidsdk/guide/interaction/gesture</div></div></div><div class="wrap_right_nav_r">下载源码</div><!-- 安卓源码地址 --><div class="github-url-and">//mapopen-website-wiki.bj.bcebos.com/demos/BaiduMapSDKExample.zip</div></div><div class="wrap_table"><div class="table_nav"><div class="left-icon"></div><div>核心接口</div></div><div class="table_wrap"><div class="table_wrap_title"><div>类</div><div>接口</div><div>描述</div></div><!-- 表格接口,可有多个 --><div class="table_wrap_con"><div class="table_wrap_w"><div><div class="table-wrap-className">TextureMapView</div></div><div><div>getMap()</div></div><div><div>获取地图控制器</div></div></div><!--  --><div class="table_wrap_w"><div><div class="table-wrap-className">ViewPager</div></div><div><div>onPageSelected(int position)</div></div><div><div>viewPage选中回调</div></div></div><div class="table_wrap_w"><div><div class="table-wrap-className">ViewPager</div></div><div><div>canScroll(View v, boolean checkV, int dx, int x, int y)</div></div><div><div>用于判断viewPage页面是否可以切换</div></div></div></div></div></div></div></div><div class="pre-nav"><div class="left-icon"></div><div>核心代码</div></div><div class="pre-nav"><div>1.判断viewPage是否可以切换</div></div><div class="pre-wrap"><div class="pre-wrap-nav"><div>JAVA</div></div><!-- 安卓示例代码位置 --><div class="pre-wrap-w pre-wrap-w-and"><pre class="prettyprint prettyprinted pre-and">protected boolean canScroll(View v, boolean checkV, int dx, int x, int y) {
 
</div><div class="video-icon-and"><div class="play play-and"></div><div class="stop stop-and"></div></div></div><div class="progressWrap-hide-and"></div><div id="videoControls-and"><div id="progressWrap-and"><div id="playProgress-and"></div></div></div></div><div class="left-qrCode"><!-- 安卓二维码位置 --><div class="qrCode-and">1590746640|//mapopen-website-wiki.bj.bcebos.com/demos/newqrcodes/手势冲突@2xanidroid.png</div><div>扫码体验</div></div></div><div class="wrap_right"><div class="wrap_right_nav"><div class="wrap_right_nav_l"><div>使用产品</div><div><!-- 安卓使用产品下选项,可有多个 --><div class="documentA">Android地图SDK|/index.php?title=androidsdk</div><div>></div><div class="documentA">控件与手势|/index.php?title=androidsdk/guide/interaction/gesture</div></div></div><div class="wrap_right_nav_r">下载源码</div><!-- 安卓源码地址 --><div class="github-url-and">//mapopen-website-wiki.bj.bcebos.com/demos/BaiduMapSDKExample.zip</div></div><div class="wrap_table"><div class="table_nav"><div class="left-icon"></div><div>核心接口</div></div><div class="table_wrap"><div class="table_wrap_title"><div>类</div><div>接口</div><div>描述</div></div><!-- 表格接口,可有多个 --><div class="table_wrap_con"><div class="table_wrap_w"><div><div class="table-wrap-className">TextureMapView</div></div><div><div>getMap()</div></div><div><div>获取地图控制器</div></div></div><!--  --><div class="table_wrap_w"><div><div class="table-wrap-className">ViewPager</div></div><div><div>onPageSelected(int position)</div></div><div><div>viewPage选中回调</div></div></div><div class="table_wrap_w"><div><div class="table-wrap-className">ViewPager</div></div><div><div>canScroll(View v, boolean checkV, int dx, int x, int y)</div></div><div><div>用于判断viewPage页面是否可以切换</div></div></div></div></div></div></div></div><div class="pre-nav"><div class="left-icon"></div><div>核心代码</div></div><div class="pre-nav"><div>1.判断viewPage是否可以切换</div></div><div class="pre-wrap"><div class="pre-wrap-nav"><div>JAVA</div></div><!-- 安卓示例代码位置 --><div class="pre-wrap-w pre-wrap-w-and"><pre class="prettyprint prettyprinted pre-and">protected boolean canScroll(View v, boolean checkV, int dx, int x, int y) {
 
     if (Math.abs(dx) > 30) {
 
     if (Math.abs(dx) > 30) {

2023年8月16日 (三) 19:32的最后版本

手势冲突
功能场景
常用于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;
    }
}
            
                
复制
深色
复制成功
  • 文档根本没法用

  • 文档水平很差

  • 文档水平一般

  • 文档不错

  • 文档写的很好

如发现文档错误,或对此文档有更好的建议,请在下方反馈。问题咨询请前往反馈平台提交工单咨询。

提交反馈

拖动标注工具

添加矩形标注

添加箭头标注

完成

取消