My app has a custom night mode that switches to white on black. The central view is a WebView displaying text.
In night mode, I used an extra css file that showed white text on black backbround, but users complained about the white scroll bar on the right. Therefore, I had the same problem as described above. However, I needed to turn the night mode on and off at runtime, but I didn't want to just hide the scroll bars.
A simple solution I used:
if (isNightMode()) { webView.setBackgroundColor(Color.BLACK); } else { webView.setBackgroundColor(Color.WHITE); }
The backgroundColor WebView setting affected the scroll bars as needed.
Martin Oct 22 '11 at 12:21 2011-10-22 12:21
source share