The only obvious solution I see at the moment would be to make the use of a ScrollView unnecessary by including both header and footer in the post HTML, but that doesn't seem feasible or desirable at the moment. Even if we changed our configuration to allow that, the WebView scroll methods also wouldn't work when inside a ScrollView, naturally. This also doesn't work, as the WebView doesn't let us handle anchor links with our current configuration. However, the anchor and ID attribute has to be the same so that the link works. Add ID along with the anchor name and choose the second step. For this, you need to switch to (HTML) in the WordPress editor. Intercepting the link and programmatically scroll the WebView. Add an ID on the header so that anchor link can jump to it.In this case anchor links worked, but everything else was quite broken. Replacing the ScrollView with a RecyclerView (with separate header, content and footer items).Messing around with some scrolling attributes (like scrollContainer) on both the ScrollView and WebView to see if there was any way to better handle the scrolling events.When a link with the href attribute, which value has is clicked, the plugin performs a progressive scrolling animation. Replacing the ScrollView with a NestedScrollView and set android:fillViewport="true". Page scroll to id is a fully-featured free WordPress plugin that adds a smooth animation, where the browser to a jumping behavior, with a smooth scrolling animation.Measuring the WebView height and manually set its layout params.Here's a list of ideas and quick hacks I tried: Click the Advanced section on the right side of the Settings Panel. Again, this can be just about anything from an image to a subheading. Of course, doing so breaks the rest of the layout. Step 1: Create the anchor target in the block settings Highlight the section of your article that you want the reader to jump to via the link. After some investigation, I have come to the conclusion that what stated above still holds: the main issue here is that we need to wrap our WebView with a ScrollView, so we can display the custom views at the top (header) and at the bottom (related posts) of the content, which causes the WebView to not handle scroll events.Īs an experiment to confirm that this was indeed the issue, I went as far as forcefully removing the ScrollView from that layout just to see if the anchor links would start working and they did.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |