SystemWebView on Android doesn't scroll - android

So I have my activity (extending CordovaActivity) on Android, which loads the content, but I am unable to scroll.
I already tried to add this code into my activity:
// Display vertical scrollbar and hide horizontal scrollBar
super.appView.getView().setVerticalScrollBarEnabled(true);
super.appView.getView().setHorizontalScrollBarEnabled(false);
// set scrollbar style
super.appView.getView().setScrollBarStyle(View.SCROLLBARS_INSIDE_OVERLAY);
but didn't help.
Does anyone has an experience / solution to How can I make my Cordova WebView scrollable?

Related

WebView content inside of bottom sheet of the ModalBottomSheetLayout is not scrollable

I am trying to implement WebView in a ModalBottomSheetLayout. Issue is that WebView content is not scrolling inside bottom sheet. It works fine in normal compose view. Couldn't find anything workable. Is there a way to make it working?

Android Webview SwipeRefreshLayout area

I have app android WebApp inside SwipeRefreshLayout. Problem is when I scroll down webview, SwipeRefreshLayout trigers and I am not able to scroll down webview it self.
My target: SwipeRefreshLayout to triger only from green area but still remain 100% of screen. Green Area is part of webview.
Update Css of the webpage to support webview touch scroll detect,
mostly in the case overflow property conflicts with the android swipe refresh layout. You can read further on such issues here:
SwipeRefreshLayout + WebView when scroll position is at top
or you can use webview javascript Bridge for this to resolve.

How to hook into Android ScrollView when it starts/ends scrolling?

How do I programmatically hook into an Android ScrollView when it starts/ends scrolling? I have a custom View which is placed inside a ScrollView. I want my custom View to be informed right before the scrolling begins and just after the scrolling ends to execute some arbitrary code.
Note: I'm coming from iOS development and basically I'm looking for the Android equivalent of UIScrollViewDelegate.
For achieveing this, you need to create a Custom scrollview by inheriting from scrollview.
Check below link. It will help you :
Synchronise ScrollView scroll positions - android
Android: Detect when ScrollView stops scrolling

Android ScrollView containing LinearLayout with WebView scroll behavior

I have a view hierarchy like this, a vertical ScrollView with a vertical LinearLayout containing two children:
ScrollView ->orientation:vertical, width:fill_parent, height: fill_parent
LinearLayout -> orientation:vertical, width:fill_parent, height: fill_parent
WebView -> width:fill_parent, height: fill_parent
GoogleAdView -> width:wrap_content, height:wrap_content
When scrolling to the bottom of the webview and clicking on any link there, though the page loads , the scrollbar stays at the bottom rather than moving to the top. I can programatically set the scroll using scroll.fullScroll(ScrollView.FOCUS_UP), but that causes the scrollbar to jump up visibly. I have tried hiding the scrollbar before the page loads with scrollView.setVerticalScrollBarEnabled(false) and then re-enabling it after the page loads before calling scroll.fullScroll(ScrollView.FOCUS_UP) but that still causes the scrollbar to "jump".
The WebView by itself handles scrolling much more nicely on page changes, looks like it hides the scrollbar and then makes it appear on top of the page after load. Is there a way to maintain this with ScrollView?
You cannot reliably put a WebView in a ScrollView.
Either embed your ad in your Web content, leave the banner fixed on the screen, or work out some other trigger to animate hiding the ad (e.g., goes away after 5 seconds).
I've solved this by adding the AD inside the webview. Unfortunately you won't be able to use any Ad network SDK's, but it's a much better user experience.
Use javascript injection to insert your ads after the webview loads.
The trick is to use loadDataWithBaseURL when loading content into the WebView. Simply doing a loadData doesn't cause the scroll offset to reset.

Enabling scrolling for particular layout

I have facing problem in scrolling webview in verticlly, actually i have scroll view with in the layout have defined webview in layout so when i scroll the webview vertically it scroll whole layout,so i want to enable scroll for webview,
anybody help me solve this.
You need to add the scrollbars to your webview then, no need to put a surrounding scrollView.
android:scrollbars="vertical"
and other android:scroll* attributes are available for the webview.
Wondering though why the webview doesn't scroll by default in your case, it should. Just removing the surrounding scrollView around it might already help probably.

Categories

Resources