Issue
For some reason im unable to change the background color of an empty webView in xml using android:background
. Although I could change it in java code using something like this:
myWebView.setBackgroundColor(Color.parseColor("#D4CAB4"));
But I prefer to do it in xml and I cant find the reason why android:background
is not working?
Solution
If one can set WebView background color in xml layout the answer is "NO" and the reason behind is:
- Set Background Color of WebView. (XML LAYOUT)
- You load data on webView in activity class.
- The background you set in the step 1 will be ignored and default color will be set.
- The only method left is to set the background of WebView after the data is loaded.
I hope this can help you to understand the case here.
Answered By - SALMAN
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.