1

I am making a div invisible by setting div.style.visibility="hidden"; which perfectly works in samsung, sony phones. Also perfectly works for desktop browsers, chrome mozilla. (And it should be.. )

But sometimes, it is not working in google nexus 4 (android 4.3). Tested in multiple nexus 4 device.

observations :

  1. I have multiple dialogs, which navigates between one another. In this process, I hide the previous dialog and make the next dialog visible. This works perfectly fine until I open a heavy dialog, which has 100 divs with multiple images. Now, when I try to go back to a previous dialog, div visibility and opacity stop working. All dialogs remain visible in the background. style.opacity = 0 also doesn't work. visibility and opacity works perfectly fine, doesn't matter how many time I switch between dialogs, until I create that heavy dialog.
  2. when a div is visible in the background, which should not be visible at all, and I lock and unlock the phone, this problem gets resolved. Everything starts working smoothly. Also, if I wait for sometime, everything falls back in place. Starts working perfectly again.

Tried couple of things :

1. webView.setLayerType(View.LAYER_TYPE_SOFTWARE/HARDWARE, null);
2. webSettings.setRenderPriority(RenderPriority.HIGH/LOW);
  1. I will make that div small (with less inner divs) and try again tomorrow.
  2. I will test in nexus 7 tab and other devices if possible.
  3. I will test in nexus web browser.

For the time being, if anyone has any suggestion, please let me know

Sanmoy
  • 589
  • 2
  • 9
  • 23
  • try `display:none`, it may screw up your layout though. – what is sleep Nov 04 '13 at 18:36
  • thanks, I will try it. Want to make it working by any means. The code is pretty simple and expected to work seamlessly on any platform. – Sanmoy Nov 04 '13 at 18:51
  • 1
    `display:none` also doesn't have any impact. looks like a ghost image which persists on the screen. Tested with a smaller div(with less inner divs), and the problem doesn't occur. looks like a performance bug, when there is a heavy div, webview tries to keep the already rendered images. – Sanmoy Nov 05 '13 at 05:10
  • Yeah I guess so. Not sure how to solve your issue but good luck. – what is sleep Nov 05 '13 at 14:05
  • @Sanmoy - do you have any solution ? – Mohammed Imran N Oct 19 '15 at 05:23

0 Answers0