CSS + Phonegap = Not rendering correctly

久未见 提交于 2019-12-24 03:08:37

问题


I'm facing a problem that i've been fighting from a long time, but i still don't have an answer. I looked for it in tons of foruns and websites, but nothing really works. Anyone faced the same problem and solved it?

The problem: I have a page with multiple divs on it, and each div is a page. Everytime i click on a button, one of the divs get visible and the others hidden. Here comes the problem: If i click multiple time on different links (to change the visible div), it stops rendering the correct content and blocks in one of them. I noticed that the contect is loaded, just don't render on the screen. I noticed it, because if i turn the cellphone in landscape and then in portrait, the content renders correctly and shows what i wanted.

Seems that this error occurs because the phone doesn't render the content properly. Is there a way to solve it? Maybe forcing the renderization? How can i make it? i couldn't find anything.

I looked and tried tons of codes, the one that worked for me was using the followind css, but it brings me a lot of problem. The textboxes start moving when i type and sometimes it doesnt accept some characters, and many other strange problems.

The code: -webkit-transform: translate3d(0px,0px,0px);

I'm using in my html files the following code also: <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">. It allows me to have fixed header without using any js library.

The tools i'm using: Phonegap 2.5, android 2.3.4

Any idea?

Thank you

PS: I decided to don't publish the code, because it doesn't seem to be related with what i write, but with some bug..


回答1:


I think if I remember correctly the Android 2.3x browsers do not support translate3d that should be the problem try running it on a 4.x AVD and see if it works




回答2:


This guy solved the problem:

Android WebView renders blank/white, view doesn't update on css changes or HTML changes, animations are choppy

Seems that its the only way to solve it properly, i didn't find anything but this solution...




回答3:


I had a problem similar to this, and the bug was caused because i was using "css content" property (content: '';).

If you are using this, try to remove.

best,



来源:https://stackoverflow.com/questions/15414158/css-phonegap-not-rendering-correctly

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!