Android Webkit 输入元素与 CSS3 translate3D 存在缺陷
我正在开发的 Webkit Android 应用程序中的输入元素存在一些问题。在 2.X 上进行测试,但 3.x 似乎没有这些问题...
该应用程序的工作原理是为每个“页面”提供单独的 Div,并且我使用 CSS3 translate3D 在页面之间设置动画。其中一些页面包含输入元素。当我点击输入来获得焦点时,我的任何“position:fixed”Div 都会从顶部移动约 5px,向左移动 5px。现在最重要的是……它最终会自行修复,然后当您点击输入时就再也不会发生了,这只是第一次……
我的另一个问题是,输入元素与键盘的关系很复杂,例如,拼写更正/自动完成功能不会输入文本,并且在使用 Swype 键盘时,您无法“滑动”单词,只有单独点击每个字母才会将文本输入到输入元素中。
我读到其中很多可能是由 CSS3 Translate3D 引起的。但是,我已经尝试了几乎所有方法来解决这些问题,并且我已经在几乎每个网站上搜索了解决方案,但未能找到解决方案,或找到其他遇到此问题的人...
还有其他人吗?这些问题,或者知道解决办法吗?
(可能的解决方案??)有人知道如何覆盖 webkit 中输入元素的默认行为吗?我想知道我是否可以生成自己的 TextView 并将其放置在这些输入字段上......?
非常感谢任何帮助:)
I'm having a couple issues with the Input element in a Webkit Android App i'm developing. Testing on 2.X, but 3.x doesn't seem to have these issues...
The app works by having separate Div's for each "page", and I'm using CSS3 translate3D to animate between the pages. Some of those pages include Input elements. When I tap on the input to gain focus, any of my "position:fixed" Div's will shift about 5px from the top, and 5px left. Now the kicker... it will eventually fix itself, and then never happen again when you tap on an input, its only that first time...
My other problem, the Input elements are screwy with keyboards, for instance, spell corrections/autocomplete will not input text, and when using Swype Keyboard, you can't "swipe" the word, ONLY individual taps for each letter will input text into the Input element.
I've read that a lot of these might be caused by CSS3 Translate3D. But, I've tried just about everything to fix these issues, and I've searched just about every site for a solution, but havent been able to find a fix, or find anyone else with this issue...
Does anyone else have these issues, or know of a fix?
(Possible solution??) Anyone know of a way to override the default behavior of Input elements in the webkit? I wonder if I can generate my own TextView and position it over these input fields...?
Any help is greatly appreciated :)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我在我的 Android 应用程序中确实经历过这种情况。 translate3d对z-index有一定的影响,并且由于android在ICS之前没有硬件加速,所以translate3d在android 2.x上使用是一个问题。尝试常规的 ole translate() ,是的,性能非常糟糕。我尽量不在 android 2.x 上做太多动画
I've certainly experienced this in my android apps. translate3d has a definite effect on z-index, and since android does not have hardware acceleration before ICS, translate3d is a problem to use on android 2.x. Try regular ole translate() and yes, the performance is pretty sad. I try not to do much animation on android 2.x