Incorrect height WebView in VerticalScrollArrangement

Hello, I'm new to App Inventor, so this is may be my fault, but I'm stuck: I want the user to confirm reading the TOS/guide before using the app. I want to display the text via a WebView that I put in a VerticalScrollArrangement. Below the WebView is a CheckBox and some buttons. The idea is that the user has to scroll all the text down before they can confirm the CheckBox and continue.
The problem is that the WebView is usually rendered with a height of 0px. I would like the WebView to be rendered with a height according to its content and the vertical scrolling of the screen is provided by the VerticalScrollArrangement.

Thank you for any suggestions.

Test_WebView.aia (81.5 KB)

Do you have to use html files, and therefore a webviewer?

You can use a label instead, which fills as you want, to the length of the text. Set the label to use HTMLContent to keep your formatting (note: not all html tags are available to the label).

Only issue I found was that the VSA does not return to the top of the page when loading new text to the label, so I have included a scroll handler extension (this won't work if you are using ios). You may/may not need this in your workflow.

Here is an example:

wvTos.aia (20.7 KB)

Credits @vknow360 for his Scroll Handler extension
You can get the scroll handler extension HERE

it's not quite a perfect solution, because I really like the option to mark a part of the text and copy it to the clipboard, but it's definitely an option that I didn't think of and it works great. Thanks for the help.

Try with a multiline textbox, you can select text in there, or use a label extension to do the same.

Had a think.

Set the label text colour to white, set the html to a label, get the height of the label, set this height to the webviewer, show the html file.

wvTos_revised.aia (21.5 KB)

1 Like

This hack made my day. I love it! This solution works exactly as I imagined. Thank you for your invention and time!

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.