首页 \ 问答 \ JQuery mobile中WebView底部的空白区域(White space at bottom of WebView in JQuery mobile)

JQuery mobile中WebView底部的空白区域(White space at bottom of WebView in JQuery mobile)

我使用的是jquery-mobile的1.0a3版本。 问题是约有一个白色空间。 40像素被添加到WebView的底部。 在Android模拟器中,空白不会总是出现,当它出现时,我得到a Can't get the viewWidth after the first layout警告Can't get the viewWidth after the first layout 。 在2.3.3上。 设备的白色空间总是显示出来。

我尝试切换到版本1.0a2,1.0a4和1.0b2,但在1.0a2上,屏幕在取向变化时变为空白,而在1.0b2和1.0a4上,以不希望的方式分割按钮外观变化。 在CSS中我没有改变自己。

为了摆脱白色空间,可能会发生什么变化?


I am using 1.0a3 version of jquery-mobile. The problem is that a white space of approx. 40 px is added to the bottom of a WebView. In the Android emulator the white space doesn't appear always, when it does, i get a Can't get the viewWidth after the first layout warning. On a 2.3.3. device the white space does always show up.

I tried switching to version 1.0a2, 1.0a4 and 1.0b2, but on 1.0a2 the screen goes blank on orientation change, and on 1.0b2 and 1.0a4 split button appearance changes in a not desired way. I haven't changed nothing myself in the css.

What could be the things to change to get rid of the white space?


原文:https://stackoverflow.com/questions/6888507
更新时间:2023-02-08 16:02

最满意答案

您还可以使用NumPy库(它不是标准库的一部分,但是相对容易获得),它具有以下功能:

>>> import numpy as np
>>> np.arange(0.0, 1.0, 0.1)
array([ 0. ,  0.1,  0.2,  0.3,  0.4,  0.5,  0.6,  0.7,  0.8,  0.9])

以及linspace功能,可以控制端点发生的情况(当事情不会总是划分成正确数量的“slice”时,浮点数不是微不足道的):

>>> np.linspace(0,1,11)
array([ 0. ,  0.1,  0.2,  0.3,  0.4,  0.5,  0.6,  0.7,  0.8,  0.9,  1. ])
>>> np.linspace(0,1,10,endpoint=False)
array([ 0. ,  0.1,  0.2,  0.3,  0.4,  0.5,  0.6,  0.7,  0.8,  0.9])

Rather than using a decimal step directly, it's much safer to express this in terms of how many points you want. Otherwise, floating-point rounding error is likely to give you a wrong result.

You can use the linspace function from the NumPy library (which isn't part of the standard library but is relatively easy to obtain). linspace takes a number of points to return, and also lets you specify whether or not to include the right endpoint:

>>> np.linspace(0,1,11)
array([ 0. ,  0.1,  0.2,  0.3,  0.4,  0.5,  0.6,  0.7,  0.8,  0.9,  1. ])
>>> np.linspace(0,1,10,endpoint=False)
array([ 0. ,  0.1,  0.2,  0.3,  0.4,  0.5,  0.6,  0.7,  0.8,  0.9])

If you really want to use a floating-point step value, you can, with numpy.arange.

>>> import numpy as np
>>> np.arange(0.0, 1.0, 0.1)
array([ 0. ,  0.1,  0.2,  0.3,  0.4,  0.5,  0.6,  0.7,  0.8,  0.9])

Floating-point rounding error will cause problems, though. Here's a simple case where rounding error causes arange to produce a length-4 array when it should only produce 3 numbers:

>>> numpy.arange(1, 1.3, 0.1)
array([1. , 1.1, 1.2, 1.3])

相关问答

更多
  • 你在这里遇到的基本上是浮点运算背后的问题。 请参阅此问题以获取有关正在发生的事情及其发生原因的更多信息 。 总结一下,只需看看你的drange(0.1, 0.9, 0.1) : >>> list(drange(0.1, 0.9, 0.1)) [0.1, 0.2, 0.30000000000000004, 0.4, 0.5, 0.6, 0.7, 0.7999999999999999, 0.8999999999999999] 如您所见,您无法获得准确的结果。 因此,当你总结它们时,你将得不到精确的1 。 相反 ...
  • 如果您正在查找0到1之间的随机数字列表,我认为您可能会很好地使用random模块 >>> import random >>> [random.random() for _ in range(0, 10)] [0.9445162222544106, 0.17063032908425135, 0.20110591438189673, 0.8392299590767177, 0.2841838551284578, 0.48562600723583027, 0.15468445000916797, 0.4314 ...
  • 您还可以使用NumPy库(它不是标准库的一部分,但是相对容易获得),它具有以下功能: >>> import numpy as np >>> np.arange(0.0, 1.0, 0.1) array([ 0. , 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9]) 以及linspace功能,可以控制端点发生的情况(当事情不会总是划分成正确数量的“slice”时,浮点数不是微不足道的): >>> np.linspace(0,1,11) array( ...
  • 使用numpy的范围代替范围: import numpy as np for x in np.arange(0, 1, 0.1): print(x) use numpy's arange instead of range: import numpy as np for x in np.arange(0, 1, 0.1): print(x)
  • 我想你将不得不使用JavaScript。 使用jQuery它将是: $('input').on('change', function() { var $this = $(this); if ($this.val() < 0.01) { $this.val('0.01'); } }); 的jsfiddle I think you're going to have to use JavaScript. With jQuery it would be: $('input').on('chan ...
  • 使用Range#cover执行此操作: if (9.74...9.78).cover? amounts count += 1 end 示例: p (9.74...9.78).cover? 9.75 # => true p (9.74...9.78).cover? 9.79 # => false 更新为@m_x建议 # will give you the element in the range array.select{ |item| (9.74..9.78).cover? item } # w ...
  • 离子范围圆步到积分。 val = Math.round(val); 因此,您有两种方法可以:修改“.. \ node_modules \ ionic-angular \ components \ range \”或进行解决方法。 例如,您可以使用ratio计算十进制值或设置max = 3000,然后在控制器中使用该值除以100.(假设您将2553作为值,然后当您将其除以100时得到25.53) ion-range round step to integral. val = Math.round(val); ...
  • 范围运算符本身不支持跳过/步进,但是如果运行的是4.0或更高版本,则可以使用Where-Object (或Where()方法来过滤掉每秒: PS C:\> (1..10).Where({$_ % 2 -eq 0}) 2 4 6 8 10 2.0及更高版本: PS C:\> 1..10 |Where-Object {$_ % 2 -eq 0} 2 4 6 8 10 The range operator itself doesn't support skipping/stepping, but you co ...
  • 也许我误会了,但你不能这样做吗? var a = {28.82:"a", 28.91:"b", 29.11:"c", 30.11:"d", 32.22:"e", 32.23:"f", 32.24:"g"}; function check(range){ if (a[range] || a[range+0.01] || a[range-0.01]){ // do stuff here... } } 或者你担心的方法太贵了? 注意逻辑检查if(a[range])如果a[ ...

相关文章

更多

最新问答

更多
  • h2元素推动其他h2和div。(h2 element pushing other h2 and div down. two divs, two headers, and they're wrapped within a parent div)
  • 创建一个功能(Create a function)
  • 我投了份简历,是电脑编程方面的学徒,面试时说要培训三个月,前面
  • PDO语句不显示获取的结果(PDOstatement not displaying fetched results)
  • Qt冻结循环的原因?(Qt freezing cause of the loop?)
  • TableView重复youtube-api结果(TableView Repeating youtube-api result)
  • 如何使用自由职业者帐户登录我的php网站?(How can I login into my php website using freelancer account? [closed])
  • SQL Server 2014版本支持的最大数据库数(Maximum number of databases supported by SQL Server 2014 editions)
  • 我如何获得DynamicJasper 3.1.2(或更高版本)的Maven仓库?(How do I get the maven repository for DynamicJasper 3.1.2 (or higher)?)
  • 以编程方式创建UITableView(Creating a UITableView Programmatically)
  • 如何打破按钮上的生命周期循环(How to break do-while loop on button)
  • C#使用EF访问MVC上的部分类的自定义属性(C# access custom attributes of a partial class on MVC with EF)
  • 如何获得facebook app的publish_stream权限?(How to get publish_stream permissions for facebook app?)
  • 如何防止调用冗余函数的postgres视图(how to prevent postgres views calling redundant functions)
  • Sql Server在欧洲获取当前日期时间(Sql Server get current date time in Europe)
  • 设置kotlin扩展名(Setting a kotlin extension)
  • 如何并排放置两个元件?(How to position two elements side by side?)
  • 如何在vim中启用python3?(How to enable python3 in vim?)
  • 在MySQL和/或多列中使用多个表用于Rails应用程序(Using multiple tables in MySQL and/or multiple columns for a Rails application)
  • 如何隐藏谷歌地图上的登录按钮?(How to hide the Sign in button from Google maps?)
  • Mysql左连接旋转90°表(Mysql Left join rotate 90° table)
  • dedecms如何安装?
  • 在哪儿学计算机最好?
  • 学php哪个的书 最好,本人菜鸟
  • 触摸时不要突出显示表格视图行(Do not highlight table view row when touched)
  • 如何覆盖错误堆栈getter(How to override Error stack getter)
  • 带有ImageMagick和许多图像的GIF动画(GIF animation with ImageMagick and many images)
  • USSD INTERFACE - > java web应用程序通信(USSD INTERFACE -> java web app communication)
  • 电脑高中毕业学习去哪里培训
  • 正则表达式验证SMTP响应(Regex to validate SMTP Responses)