问题描述
我在 Sencha Touch 中有一个应用程序,其中有一个 textareafield.在 Chrome 中,这是可以调整大小的,但在使用 iPhone 时则不能(我还没有在 Android 设备上尝试过).
I have an application in Sencha Touch where I have a textareafield. In Chrome, this is resizeable, but not when using an iPhone (I haven't tried on an Android device).
我需要一个文本输入区域,人们可以在其中输入从一两个单词到许多句子的任何文本.所以我需要它来自动调整大小;有一些手动调整大小的方法;或在其中滚动的某种方式.
I need to have a text input area where people can enter text anything from one or two words long to many sentences. So I need this to either automatically resize; have some way of manually resizing it; or some way of scrolling within it.
到目前为止,我还无法使用 Sencha Touch 执行任何这些操作.如果有人能给我指出一个可行的解决方案,我将不胜感激.它不需要是 Sencha Touch 中的任何特定组件.
So far I have been unable to do any of these with Sencha Touch. I would really appreciate it if someone can point me towards a workable solution. It doesn't need to be any specific component in Sencha Touch.
推荐答案
Google Code 博客上有一篇文章解释了他们如何处理移动 Gmail 中的 textarea 自动增长.这是链接:http://googlecode.blogspot.com/2009/07/gmail-for-mobile-html5-series.html
There is a post on the Google Code blog explaining how they handled textarea auto growing in Mobile Gmail. Here's the link: http://googlecode.blogspot.com/2009/07/gmail-for-mobile-html5-series.html
我用 jsfiddle 制作了一个快速示例:http://jsfiddle.net/rFcUH/
I threw together a quick sample with jsfiddle: http://jsfiddle.net/rFcUH/
我是用 Sencha Touch 1.1 做到的,不过类似的东西应该可以用在 Sencha Touch 2 上.
I did it with Sencha Touch 1.1, though something similar should work with Sencha Touch 2.
这篇关于如何在 Sencha Touch 中创建可调整大小的文本区域?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!