首页 \ 问答 \ 带有Cordova的Windows Phone(通用)上的文本输入焦点问题(Text input focus issue on Windows Phone (Universal) with Cordova)

带有Cordova的Windows Phone(通用)上的文本输入焦点问题(Text input focus issue on Windows Phone (Universal) with Cordova)

我目前正在使用Cordova平台构建移动应用程序。 该应用程序针对Android,iOS和Windows Phone 8.最近,我不得不将后者更改为Windows Phone 8.1(通用)。 添加winstore-jscompat库并对CSS进行一些更改后,所有内容似乎都以相同的方式工作。

只有不起作用的是滚动到聚焦元素。 在Windows Phone 8中,它看起来像这样:

在WP8之前(忽略底部较暗的矩形)

在WP8之前

和WP8之后

WP8之后

但是在Windows Phone Universal上,视图不适合屏幕,光标处于奇怪的位置。

在WP8.1之前(通用)

在WP8.1之前

在WP8.1(通用)之后。 您可以在红色箭头标记的位置看到光标。 在WP8.1之后

我在Visual Studio 2015 CTP 6(14.0.22609.0)中使用Cordova Tools。 使用/ bld目录中的构建项目可以得到相同的结果。

有没有人遇到过这样的错误? 我怎样才能解决这个问题?


I'm currently building a mobile app using Cordova platform. The app was targeted on Android, iOS and Windows Phone 8. Recently, I had to change the latter to Windows Phone 8.1 (Universal). After adding the winstore-jscompat library and making couple changes to CSS everything seems to work the same way.

Only thing that is not working is scrolling to focused element. In Windows Phone 8 it looks like this:

Before WP8 (Ignore the darker rectangle on the bottom)

Before WP8

And After WP8

After WP8

But on Windows Phone Universal the view is not going up to fit to the screen and the cursor is in weird place.

Before WP8.1 (Universal)

Before WP8.1

And After WP8.1 (Universal). You can see cursor in the place marked by a red arrow. After WP8.1

I'm using Cordova Tools in Visual Studio 2015 CTP 6 (14.0.22609.0). Using built project from /bld directory gives the same results.

Has anyone came across such bug? How can I fix this?


原文:https://stackoverflow.com/questions/29972637
更新时间:2022-01-01 07:01

最满意答案

通常,当您使用javascript库时,您需要两个文件,一个.js ,它是javascript代码,也可以是一个.css文件,其中包含库用于格式化DOM元素的css格式规则。

在您发布的示例中,您有四行,这是因为您有2个库 ,一个是jQuery ,另一个是jQuery-ui ,它是一个依赖于jQuery的不同的库。

关于.min扩展名,它表示有问题的文件是库代码的最小化版本 ,也就是说,它是普通的.js库文件,但删除了空格,变量名称更改为短长度,以及其他优化以获取一个文件大小很小的.js文件,因此浏览器下载和执行的速度更快。


Usually, when you use a javascript library, you need two files, a .js which is the javascript code and optionally, a .css file which contains css formating rules that the library uses to format DOM elements.

In the example you posted you have four lines, that's because you have 2 libraries in there, one is jQuery, and the other jQuery-ui, which is a different library that depends on jQuery one.

About the .min extension, it indicates the file in question is a minimized version of the library code, that is, it's the normal .js library file but with spaces removed, variable names changed to short length, and other optimizations in order to obtain a .js file with a much small file size so it's faster to download and execute by the browser.

相关问答

更多
  • Frek! 为什么要包含3个jquery文件? 这是Google CDN的最新jquery版本。 仅用于: 我不知道你为什么要包括jqueryUI,但如果它是必要的,那就让它成为。 并使用以下脚本: jQuery(document).ready(function($) { // Now you can use $ instead of j ...
  • 正确的语法是: JavaScript.RequestRegistration("jQuery", new Version(1, 9, 1)); The proper syntax is: JavaScript.RequestRegistration("jQuery", new Version(1, 9, 1));
  • 使用Composer时选择性地使用不同配置的自动加载器是没有意义的。 原因如下: Composer创建一些包含配置数据的文件来执行自动加载。 该代码可能是最优化的代码,即使对于大型场景也是如此,如果PHP运行时具有更强大的功能(如PHP 5.6及更高版本),则使用不同的例程。 所以最后,可能有三到四个文件必须从磁盘读取并执行。 PHP使用Opcache(如果你喜欢性能,你不应该禁用它)。 所有用于自动加载的文件都放在Opcache中。 所以多次执行它们会被缓存,并且尽可能快。 当使用PHP 5.6及更高版本 ...
  • 通常,当您使用javascript库时,您需要两个文件,一个.js ,它是javascript代码,也可以是一个.css文件,其中包含库用于格式化DOM元素的css格式规则。 在您发布的示例中,您有四行,这是因为您有2个库 ,一个是jQuery ,另一个是jQuery-ui ,它是一个依赖于jQuery的不同的库。 关于.min扩展名,它表示有问题的文件是库代码的最小化版本 ,也就是说,它是普通的.js库文件,但删除了空格,变量名称更改为短长度,以及其他优化以获取一个文件大小很小的.js文件,因此浏览器下载 ...
  • Google Closure图书馆 它包含(引自链接): 一大组可重用的UI小部件和控件,以及DOM操作,服务器通信,动画,数据结构,单元测试,富文本编辑等的底层实用程序。 它还包含一组很好的字符串操作方法,在goog.string命名空间中。 下划线 Underscore是一个JavaScript实用程序库,它提供了许多Prototype.js中预期的函数式编程支持 Underscore旨在与其他库一起使用,例如jQuery或原型。 不过,它不像jQuery或Google Closure那样可扩展。 Go ...
  • 我想这个方法名称冲突的问题。 访问https://github.com/seiyria/bootstrap-slider#what-if-there-is-already-a-slider-plugin-bound-to-the-jquery-namespace I guess the problem with conflicting name of the method. Visit https://github.com/seiyria/bootstrap-slider#what-if-there-is- ...
  • 这个双管( || )是逻辑“或”运算符。 如果jQuery已经加载到页面上,则定义window.jQuery ,以便表达式的这部分评估为true,并且不评估第二部分。 否则,将评估第二部分,并且该部分实际上执行了某些操作: script标记附加到文档,导致浏览器在给定URL处加载资源。 在Bootstrap的主页(使用Bootstrap)上,我可以看到之前的行是: