Open tsonevn opened 7 years ago
Hi @public-virtualys, Thank you for reporting this issue. I tested this case in the sample project and was able to recreate the problem. The issue is reproducible only on Android. I am attaching sample project, which could be used for debugging. Please keep track on the issue for further info. Archive.zip
Edit:
In our further research, we found that the issue is related to the ScrollView component. Using it for a container will prevent the HtmlView
from calculating the correct height, where the backgroundColor should be applied.
As a temporary solution, you could set up for Android the backgroundColor to the ScrollView. for example:
<ScrollView backgroundColor="green">
<StackLayout>
..............
</StackLayout>
</ScrollView>`
Unfortunately, i can't use the ScrollView itself as i am implementing a parallax effect on scroll ; the HtmlView has to overlap an image during scroll, and then i need a solid background color. Any other thoughts ?
Using WebView instead of HtmlView is also a possible workaround.
Ah man, i'm having this issue with WebView and wanted to know if you guys ever found a solution.
Basically my container (A StackLayout within a ScrollView) contains a WebView and when it increases over 2000 height the background color from the StackLayout disappears (white).
I've tried manually setting the height to be certain numbers etc but it seems like 2k is the value in which the stacklayout blows up. Everything renders fine but the background color. The box shadow (androidElevation="12") and everything else is still present and looks fine.
From @public-virtualys on October 18, 2017 9:10
Which platform(s) does your issue occur on?
Android
Please provide the following version numbers that your issue occurs with:
Please tell us how to recreate the issue in as much detail as possible.
Get a very basic reusable component, that displays a header and a body with enabled scrolling :
Then use it in a page, displaying some html paragraphs :
It works as expected, with header having a red background color, and HTML text a green one.
Now, increase HtmlView bounds in adding some extra paragraphs : change the for loop bound to 30 instead of 8. Then the problem occurs : the HtmlView successfully displays all the 30 paragraphs of text, but there is no more background color under it - neither green nor even yellow.
Simulated on an emulated device using AVD, and reproduced on an Sony Xperia Z3 Tablet Compact / Android 6.0.1.
Is there code involved? If so, please share the minimal amount of code needed to recreate the problem.
Given on the previous paragraph.
Copied from original issue: NativeScript/NativeScript#4961