sencha touch textarea 手机上不显示滚动条,且不能滚动
最近在项目中发现 sencha touch 中的 textarea 在手机上不显示滚动条,也不能滚动。
在浏览器中之所以能显示滚动条滚动,那是浏览器为 textarea 添加的滚动条。 但在手机中是不会显示滚动条的。 可能在以后的版本中会有所改进吧。
于是只能另想办法了,找了一个老外重写的可滑动的 textarea (无滚动条)。
转:
Ext.define('LeslieTest.view.TextArea',
{
extend : 'Ext.field.TextArea',
xtype : 'scrollTextArea',
initialize : function() {
this.callParent();
this.element.dom.addEventListener(
Ext.feature.has.Touch ? 'touchstart'
: 'mousedown',
this.handleTouchListener = Ext.bind(
this.handleTouch, this), false);
this.element.dom.addEventListener(
Ext.feature.has.Touch ? 'touchmove'
: 'mousemove',
this.handleMoveListener = Ext.bind(
this.handleMove, this), false);
this.moveListenersAttached = true;
},
destroy : function() {
if (this.moveListenersAttached) {
this.moveListenersAttached = false;
this.element.dom.removeEventListener(
Ext.feature.has.Touch ? 'touchstart'
: 'mousedown',
this.handleTouchListener, false);
this.element.dom.removeEventListener(
Ext.feature.has.Touch ? 'touchmove'
: 'mousemove',
this.handleMoveListener, false);
this.handleTouchListener = this.handleMoveListener = null;
}
this.callParent();
},
handleTouch : function(e) {
this.lastY = e.pageY;
},
handleMove : function(e) {
var textArea = e.target;
var top = textArea.scrollTop <= 0;
var bottom = textArea.scrollTop + textArea.clientHeight >= textArea.scrollHeight;
var up = e.pageY > this.lastY;
var down = e.pageY < this.lastY;
this.lastY = e.pageY;
if ((top && up) || (bottom && down))
e.preventDefault();
if (!(top && bottom))
e.stopPropagation();
}
});
sencha touch textarea 手机上不显示滚动条,且不能滚动的更多相关文章
- android的开发 华为手机上不显示menu键
android的开发,华为手机上不显示menu键解决办法: 在AndroidManifest.xml中讲targetSdkVersion改为9. <uses-sdk android:minSdk ...
- 手机上无法显示Toast信息
关于手机上无法显示Toast信息, 是因为手机上的权限没有开, 在应用管理处将所有权限都打开,就可以显示了.
- Android popupwindow在低版本手机上无法显示
popupwindow偶尔的显示失效(在低版本Android系统的手机上,测试机6.0)实在是坑害了不少人,害,而且坑了for a long time.本小白就是其中一个受害者. 百度了N久N多还是没 ...
- 跨平台的移动应用开发框架-Sencha Touch
版权声明:本文为博主原创文章.未经博主同意不得转载. https://blog.csdn.net/tommychen1228/article/details/32959529 近期决定转以日常技术类文 ...
- sencha touch 问题汇总
做sencha touch有一段时间了,目前而言,sencha touch在android上问题比较严重,在此对android中sencha touch的问题做一些汇总: 1.内存问题: 打包成安装程 ...
- [Phonegap+Sencha Touch] 移动开发19 某些安卓手机上弹出消息框 点击后不消失的解决的方法
Ext.Msg.alert等弹出框在某些安卓手机上,点击确定后不消失. 原因是: 消息框点击确定后有一段css3 transform动画,动画完毕后才会隐藏(display:none). 有些奇葩手机 ...
- 再探 Ext JS 6 (sencha touch/ext升级版) 变化篇 (编译命令、滚动条、控制层、模型层、路由)
从sencha touch 2.4.2升级到ext js 6,cmd版本升级到6.0之后发生了很多变化 首先从cmd说起,cmd 6 中sencha app build package不能使用了,se ...
- sencha touch 扩展篇之将sencha touch打包成安装程序(上)- 使用sencha cmd打包安装程序
由于最近一直忙着android原生的开发,很久没有更新博客了,官方的sencha cmd工具功能非常强大,创建项目,压缩项目,打包安装程序都能轻松实现,这讲我们就给大家介绍下如何使用sencha cm ...
- 关于sencha touch在华为、红米等部分手机下hide事件失效,msgbox无法关闭的解决方案(已更新最新解决方案)
(急着解决问题的同学可以直接跳最底部查看最终的解决方案) 问题描述 因为前段时间抢到了华为荣耀3c,所以做项目的时候就用荣耀3c测试了一下项目, 结果发现在华为的emotion ui上sencha t ...
随机推荐
- Subsequence——POJ3061
题目:http://poj.org/problem?id=3061 尺取法解题 import java.util.Scanner;; public class Main { public static ...
- no getter for property named 'power_state
错误信息:nested exception is org.apache.ibatis.reflection.ReflectionException: There is no getter for pr ...
- mysql连接com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure
现象:客户端连接服务器端mysql是没问题的,所有都木有问题,应用程序配置也没问题,但是连接就抛异常: com.mysql.jdbc.exceptions.jdbc4.CommunicationsEx ...
- 获取vmware虚拟机模板
在我们通过克隆虚机,需要用到虚机模板.在数据中心的目录下面有文件夹.模板和虚拟机,那么这里需要做的是根据类型做递归查询. private void GetTemplate() { System.Tex ...
- 简单的jquery左侧导航栏和页面选中
这里是要实现导航的左侧并选中的,此功能需引用jquery 左侧导航: <div class="box"> <ul class="menu"&g ...
- jenkins+windows+springboot+.net项目自动化部署图文教程
之前一直在linux中使用jenkins部署程序,正好现在的项目包括了winfrom程序,所以需要部署到windows系统中 jenkins官网:https://jenkins.io/ 下载之后运行j ...
- SQL SERVER先判断视图是否存在然后再创建视图的语句
如果我们的语句为: ? 1 2 3 4 5 6 7 8 9 10 11 12 13 IF NOT EXISTS(SELECT 1 FROM sys.views WHERE name='Report_I ...
- 清除clusternode
Import-Module FailoverClusters then clear-clusternode
- jmeter性能测试指标
1.jp@gc - Actiive Threads Over Time:不同时间的活动用户数量展示(图表) 当前的时间间隔是1毫秒,在setting中可以设置时间间隔以及其他的参数 2.jp@gc - ...
- ExclusiveTouch
Setting this property to true causes the receiver to block the delivery of touch events to other vie ...