在Android中没有应用CSS旋转(PhoneGap的) [英] Css rotation not applied in android (phonegap)
问题描述
我要建在PhoneGap的Android游戏,我有与CSS旋转div的一个问题。
我发现这里类似的问题:
<一href=\"http://stackoverflow.com/questions/9359543/css-rotation-not-applied-in-android-4-0-webview/\">CSS在不施加的转动的Android 4.0的WebView
I'm building an app for android in phonegap and I have an issue with rotating divs with css.
I have found a similar question here:
CSS rotation not applied in Android 4.0 webview
我有,我可以测试我的应用程序2 Android设备。第一个是索尼Xperia U带的Android 4.0.4
。在该设备的应用程序完美的作品。
I have 2 android devices on which I can test my app. The first one is a Sony Xperia U with android 4.0.4
. On this device the app works perfectly.
另一台设备是HTC Desire采用的Android 2.3.5
。此装置具有的CSS旋转的问题。页面加载时,图像旋转correclty但马上转回到正常。
The other device is an HTC Desire with android 2.3.5
. This device has a problem with the css rotation. When the page loads, the image is rotated correclty but immediately turns back to "normal".
我使用的CSS规则是 - WebKit的变换:旋转(90);
在一个正常的股利。
难道这是一个问题与系统的Android版本?
The css rule I'm using is - webkit-transform:rotate(90);
on a normal div.
Could this be a problem with the android version of the system?
我不能让这里的问题的保持,旋转,似乎第二个设备上工作,但只有一秒钟左右。
I can't get a hold of the problem here, the rotation seems to work on the second device, but only for a second or so.
任何建议将是AP preciated。)
Any suggestions would be appreciated :).
推荐答案
我已经试过各种可能的解决方案,当我使用WebKit的变换它仅适用:旋转(90);两次。
I've tried every possible solution and it only works when I use webkit-transform:rotate(90); twice.
下面是它如何做一个例子的工作:
Here's an example of how it did work:
<div data-role="content" style="webkit-transform:rotate(90);">
<div style="webkit-transform:rotate(90);">Stuff to rotate</div>
</div>
不过,当然,这并不正确的ohter设备上正常运行。
But of course, this did not function properly on ohter devices.
这不是一个真正的解决办法,但我只是排除了任何设备的Android版之前的4.0.4
It's not really a solution, but I just excluded any device prior to Android version 4.0.4
这篇关于在Android中没有应用CSS旋转(PhoneGap的)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!