You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@weex.apache.org by "billy (JIRA)" <ji...@apache.org> on 2018/06/29 03:48:00 UTC
[jira] [Created] (WEEX-487) Slider控件设置scrollable="false"在android上无法禁止滑动
billy created WEEX-487:
--------------------------
Summary: Slider控件设置scrollable="false"在android上无法禁止滑动
Key: WEEX-487
URL: https://issues.apache.org/jira/browse/WEEX-487
Project: Weex
Issue Type: Bug
Components: Android
Affects Versions: 0.18
Reporter: billy
Assignee: codefurture
需求是实现一个导航tab + 多个页面进行切换,但希望禁用其滑动手势,通过导航tab切换index
使用Slider控件,但按照文档设置scrollable="false"在Android设备上并没有禁用滑动手势,发现网上也有人遇到同样的问题: [https://segmentfault.com/q/1010000014254067]
查看WXSlider的源码发现:在setScrollable方法中进行了判断:
if(mAdapter.getRealCount() > 0) {
mViewPager.setScrollable(scrollable);
}
在刚创建的时候getRealCount()为0,所以未生效,我们现在采用的临时方案是在mounted回调函数中设置Slider的scrollable属性
这个mAdapter.getRealCount() > 0的判断是否可以移除呢?
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)