I have a webview in which I am showing some html text, for the same webview I have put background color as white both in xml and in the Java class. My problem is that if the text is short, only the part of the screen which has text appears with background color as white and after that the rest of the webview appears with black background color. Please help.
Have you changed the layout height and weight to fill parent ?
Also is the webview child of some other layout? It's properties also affect the layout parameters of the web view.
You seem to be using RGB instead of ARGB. Zero alpha.
Related
I'm getting white lines on some android devices.
Background screen is black but wherever some buttons or lottie animation, this line gets visible as vertical line of 2/3px, to the left part of the screen.
Shared screenshot below:
In some devices, right part of ui gets visible in left part as vertical line of 2/3px.
There is no information on internet around it, Is there any solution/workaround for these?
as there is no sample code i would look into these places:
the image itself may have a background and not fully transparent
check the xml file for items of recyclerview if there is a paddingRight or some sort of margin with white background
3.check for cardview elevation
Once I faced the same issue caused by the layout holding a button or an image view. The layout's background color was different from its parent layout, & I had to declare that layout to keep my Views & alignments. The solution to that problem was to add this attribute:
android:background="#android:color/transparent"
And why isn't there any source code?
I'm using mp android library for creating a simple barchart. I know that I can change the color of bar data set. But I want to change the background horizontal and vertical grid lines from default color of black to some other color.
"yourAxis.setGridColor();" is what you're after.
Here's a link to the Android Color page; http://developer.android.com/reference/android/graphics/Color.html
I had the most luck with the constant values, but should be able to come up with the color you're after. For example, I was able to change my X-Axis grid lines to CYAN with the following statement: xAxis.setGridColor(-16711681);
Hope this helps!
In android is there anything thing like we can create a hidden button or image and it is still clickable.or alternately is there any way to achieve this functionality in Android.
In ios we have the benefit of placing a clickable hidden button.
Everything can be achieved in Android
<Button...
android:background="#null">
You can make the button transparent or translucent by using the background property:
android:background="#ARGB"
where A is the transparency, which can be set between 0-F i.e., 0 means transparent and F means opaque.
The remaining colours are R-Red, G-Green, B-Blue.
so an eg. might be:
android:background="#200B"
which gives a tinge of blue colour.
This way you can provide transparency as well as a tinge of transparent colour to your view.
This works with any view.
Also you can apply this through code:
button.setBackgroundColour(0x220000BB);
Probably use a transparent Image to the button.
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?
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.
I have simple job to do. I have to create an Help page for my android application. On that page I want to just put a full page of text of green color with some background image. Can anybody suggest me how can I do this in my XML file. Either in GraphicalLayoutMode or XML mode.
Please suggest what are the components required to this type of Help page...
android:background="#0abcde"
to set a color
android:background="#drawable/filename"
to set a image background.
use these tags for your layout parent view.