ViewPager禁止滑动及与内层View水平滑动事件冲突解决案例

上传者: xiogjie_67 | 上传时间: 2021-06-20 01:06:43 | 文件大小: 2.35MB | 文件类型: ZIP
1、ViewPager中嵌套3个View,当从View1滑动到View2时禁止ViewPager的滑动事件。 2、通过View2底部改变页面的布局实现滑动到View1和View3. 3、View2内嵌的View中还存在一个可以左右滑动的View,在其上添加了手势,即支持左右滑动,这里存在事件冲突,需要通过事件分发来进行处理。

文件下载

资源详情

[{"title":"( 62 个子文件 2.35MB ) ViewPager禁止滑动及与内层View水平滑动事件冲突解决案例","children":[{"title":"ViewPagerScrollConflict","children":[{"title":"AndroidManifest.xml <span style='color:#111;'> 878B </span>","children":null,"spread":false},{"title":"res","children":[{"title":"layout","children":[{"title":"layout_2.xml <span style='color:#111;'> 717B </span>","children":null,"spread":false},{"title":"chang_page.xml <span style='color:#111;'> 505B </span>","children":null,"spread":false},{"title":"custom_view.xml <span style='color:#111;'> 556B </span>","children":null,"spread":false},{"title":"layout_3.xml <span style='color:#111;'> 527B </span>","children":null,"spread":false},{"title":"layout_1.xml <span style='color:#111;'> 539B </span>","children":null,"spread":false},{"title":"activity_main.xml <span style='color:#111;'> 740B </span>","children":null,"spread":false}],"spread":true},{"title":"values-w820dp","children":[{"title":"dimens.xml <span style='color:#111;'> 381B </span>","children":null,"spread":false}],"spread":true},{"title":"drawable-ldpi","children":null,"spread":false},{"title":"menu","children":[{"title":"main.xml <span style='color:#111;'> 385B </span>","children":null,"spread":false}],"spread":true},{"title":"drawable-mdpi","children":[{"title":"ic_launcher.png <span style='color:#111;'> 3.69KB </span>","children":null,"spread":false}],"spread":true},{"title":"values-v11","children":[{"title":"styles.xml <span style='color:#111;'> 334B </span>","children":null,"spread":false}],"spread":true},{"title":"drawable-hdpi","children":[{"title":"ic_launcher.png <span style='color:#111;'> 7.48KB </span>","children":null,"spread":false}],"spread":true},{"title":"drawable-xhdpi","children":[{"title":"ic_launcher.png <span style='color:#111;'> 12.22KB </span>","children":null,"spread":false}],"spread":true},{"title":"values-v14","children":[{"title":"styles.xml <span style='color:#111;'> 391B </span>","children":null,"spread":false}],"spread":true},{"title":"drawable-xxhdpi","children":[{"title":"ic_launcher.png <span style='color:#111;'> 24.20KB </span>","children":null,"spread":false}],"spread":true},{"title":"values","children":[{"title":"strings.xml <span style='color:#111;'> 240B </span>","children":null,"spread":false},{"title":"dimens.xml <span style='color:#111;'> 220B </span>","children":null,"spread":false},{"title":"styles.xml <span style='color:#111;'> 697B </span>","children":null,"spread":false}],"spread":true}],"spread":false},{"title":"src","children":[{"title":"com","children":[{"title":"example","children":[{"title":"viewpagerscrollconflict","children":[{"title":"MainActivity.java <span style='color:#111;'> 2.88KB </span>","children":null,"spread":false},{"title":"adapters","children":[{"title":"ViewPagerAdapter.java <span style='color:#111;'> 889B </span>","children":null,"spread":false}],"spread":true},{"title":"views","children":[{"title":"CustomView.java <span style='color:#111;'> 1.12KB </span>","children":null,"spread":false},{"title":"ScrollLinearLayout.java <span style='color:#111;'> 1.16KB </span>","children":null,"spread":false},{"title":"CustomViewPager.java <span style='color:#111;'> 1.53KB </span>","children":null,"spread":false}],"spread":true},{"title":"gestures","children":[{"title":"ViewPagerGestureListener.java <span style='color:#111;'> 3.88KB </span>","children":null,"spread":false}],"spread":true}],"spread":true}],"spread":true}],"spread":true}],"spread":true},{"title":"proguard-project.txt <span style='color:#111;'> 781B </span>","children":null,"spread":false},{"title":"bin","children":[{"title":"classes","children":[{"title":"com","children":[{"title":"example","children":[{"title":"viewpagerscrollconflict","children":[{"title":"adapters","children":[{"title":"ViewPagerAdapter.class <span style='color:#111;'> 1.52KB </span>","children":null,"spread":false}],"spread":true},{"title":"MainActivity$1.class <span style='color:#111;'> 1.11KB </span>","children":null,"spread":false},{"title":"BuildConfig.class <span style='color:#111;'> 379B </span>","children":null,"spread":false},{"title":"R.class <span style='color:#111;'> 843B </span>","children":null,"spread":false},{"title":"MainActivity.class <span style='color:#111;'> 3.39KB </span>","children":null,"spread":false},{"title":"views","children":[{"title":"CustomViewPager.class <span style='color:#111;'> 1.80KB </span>","children":null,"spread":false},{"title":"ScrollLinearLayout.class <span style='color:#111;'> 1.51KB </span>","children":null,"spread":false},{"title":"CustomView.class <span style='color:#111;'> 1.38KB </span>","children":null,"spread":false}],"spread":false},{"title":"R$layout.class <span style='color:#111;'> 619B </span>","children":null,"spread":false},{"title":"R$attr.class <span style='color:#111;'> 391B </span>","children":null,"spread":false},{"title":"R$style.class <span style='color:#111;'> 482B </span>","children":null,"spread":false},{"title":"R$id.class <span style='color:#111;'> 551B </span>","children":null,"spread":false},{"title":"R$string.class <span style='color:#111;'> 523B </span>","children":null,"spread":false},{"title":"gestures","children":[{"title":"ViewPagerGestureListener.class <span style='color:#111;'> 2.46KB </span>","children":null,"spread":false}],"spread":false},{"title":"R$menu.class <span style='color:#111;'> 439B </span>","children":null,"spread":false},{"title":"MainActivity$MyPageChangeListener.class <span style='color:#111;'> 1.88KB </span>","children":null,"spread":false},{"title":"R$dimen.class <span style='color:#111;'> 512B </span>","children":null,"spread":false},{"title":"R$drawable.class <span style='color:#111;'> 458B </span>","children":null,"spread":false}],"spread":false}],"spread":true}],"spread":true}],"spread":true},{"title":"dexedLibs","children":[{"title":"android-support-v4-e2da02a595034e47905429bb1b9e73bb.jar <span style='color:#111;'> 388.29KB </span>","children":null,"spread":false}],"spread":true},{"title":"AndroidManifest.xml <span style='color:#111;'> 878B </span>","children":null,"spread":false},{"title":"res","children":[{"title":"crunch","children":[{"title":"drawable-mdpi","children":[{"title":"ic_launcher.png <span style='color:#111;'> 3.04KB </span>","children":null,"spread":false}],"spread":true},{"title":"drawable-hdpi","children":[{"title":"ic_launcher.png <span style='color:#111;'> 5.82KB </span>","children":null,"spread":false}],"spread":true},{"title":"drawable-xhdpi","children":[{"title":"ic_launcher.png <span style='color:#111;'> 9.14KB </span>","children":null,"spread":false}],"spread":true},{"title":"drawable-xxhdpi","children":[{"title":"ic_launcher.png <span style='color:#111;'> 17.47KB </span>","children":null,"spread":false}],"spread":true}],"spread":true}],"spread":true},{"title":"jarlist.cache <span style='color:#111;'> 120B </span>","children":null,"spread":false},{"title":"classes.dex <span style='color:#111;'> 1.15MB </span>","children":null,"spread":false},{"title":"ViewPagerScrollConflict.apk <span style='color:#111;'> 439.75KB </span>","children":null,"spread":false},{"title":"resources.ap_ <span style='color:#111;'> 43.10KB </span>","children":null,"spread":false}],"spread":true},{"title":".classpath <span style='color:#111;'> 475B </span>","children":null,"spread":false},{"title":"assets","children":null,"spread":false},{"title":"project.properties <span style='color:#111;'> 563B </span>","children":null,"spread":false},{"title":"ic_launcher-web.png <span style='color:#111;'> 50.19KB </span>","children":null,"spread":false},{"title":".settings","children":[{"title":"org.eclipse.core.resources.prefs <span style='color:#111;'> 115B </span>","children":null,"spread":false},{"title":"org.eclipse.jdt.core.prefs <span style='color:#111;'> 177B </span>","children":null,"spread":false}],"spread":true},{"title":"libs","children":[{"title":"android-support-v4.jar <span style='color:#111;'> 1.10MB </span>","children":null,"spread":false}],"spread":true},{"title":".project <span style='color:#111;'> 859B </span>","children":null,"spread":false},{"title":"gen","children":[{"title":"com","children":[{"title":"example","children":[{"title":"viewpagerscrollconflict","children":[{"title":"R.java <span style='color:#111;'> 2.99KB </span>","children":null,"spread":false},{"title":"BuildConfig.java <span style='color:#111;'> 177B </span>","children":null,"spread":false}],"spread":false}],"spread":false}],"spread":true}],"spread":true}],"spread":false}],"spread":true}]

评论信息

  • qq_22037575 :
    还可以,有用
    2018-08-07
  • passerby_b :
    感谢分享,忘了有用没有了
    2018-04-23
  • hui201001 :
    很值得学习
    2017-11-03
  • hero_yyh :
    恩,多谢,我用上了
    2016-06-15
  • cai511 :
    不是我想要的
    2016-04-20

免责申明

【只为小站】的资源来自网友分享,仅供学习研究,请务必在下载后24小时内给予删除,不得用于其他任何用途,否则后果自负。基于互联网的特殊性,【只为小站】 无法对用户传输的作品、信息、内容的权属或合法性、合规性、真实性、科学性、完整权、有效性等进行实质审查;无论 【只为小站】 经营者是否已进行审查,用户均应自行承担因其传输的作品、信息、内容而可能或已经产生的侵权或权属纠纷等法律责任。
本站所有资源不代表本站的观点或立场,基于网友分享,根据中国法律《信息网络传播权保护条例》第二十二条之规定,若资源存在侵权或相关问题请联系本站客服人员,zhiweidada#qq.com,请把#换成@,本站将给予最大的支持与配合,做到及时反馈和处理。关于更多版权及免责申明参见 版权及免责申明