Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8283987
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T10:56:14+00:00 2026-06-08T10:56:14+00:00

I’ve got a strange issue with a WebView inside a fragment. The horizontal scrolling

  • 0

I’ve got a strange issue with a WebView inside a fragment. The horizontal scrolling doesn’t work properly. It scrolls only a bit. It’s no problem, to scroll the content vertically, pinch to zoom, and yes, moving the page with two fingers while pinching also works in all directions.

This is the onCreateView()-Method of the Fragment, that carries the WebView. I can’t use WebViewFragment.
This Fragment is inside a Viewpager! The provided data is a valid html5 document. But I’ve not successfully tried a “real webpage” as well.

this.mView = inflater.inflate(R.layout.search_results, container, false);
        mWebView = (WebView)this.mView.findViewById(R.id.search_results);
        mWebView.setWebViewClient(new SearchResultsWebViewClient());
        mWebView.setInitialScale(120);
        mWebView.setScrollContainer(true);
        mWebView.bringToFront();
        mWebView.setScrollbarFadingEnabled(true);
        mWebView.setVerticalScrollBarEnabled(true);
        mWebView.setHorizontalScrollBarEnabled(true);
        mWebView.getSettings().setBuiltInZoomControls(true);
        mWebView.getSettings().setJavaScriptEnabled(false);

        mWebView.loadData(this.data, "text/html", "utf-8");

        return this.mView;

This is the search_results.xml

    <?xml version="1.0" encoding="utf-8"?>
<WebView xmlns:android="http://schemas.android.com/apk/res/android"
    android:id ="@+id/search_results"
    android:orientation="vertical"
    android:layout_width="match_parent"
    android:layout_height="match_parent" >
</WebView>

And the layout-file in which the fragment is loaded

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
        android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="horizontal"
        android:baselineAligned="false"
        android:weightSum="1.0">

    <LinearLayout android:layout_weight="0.5"
                    android:layout_width="0dip"
                    android:layout_height="match_parent"
                    android:orientation="vertical" >        
<ListView android:id="@id/android:list"
           android:layout_width="match_parent"
           android:layout_height="match_parent"
           android:background="#000000"
           android:drawSelectorOnTop="false"/>
</LinearLayout>
     <LinearLayout android:layout_weight="0.5"
                android:layout_width="0dip"
                android:layout_height="match_parent"
                android:orientation="vertical" >
                <FrameLayout android:id="@+id/resultsWebWiewFragmentFrame"
                      android:layout_width="match_parent" 
                      android:layout_height="match_parent"/>
    </LinearLayout>
</LinearLayout>

Because I’m using ABS, it isn’t possible to load the fragment directly in the xml file. This’ll throw a ClassCastException.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-08T10:56:16+00:00Added an answer on June 8, 2026 at 10:56 am

    I just searched this and ran into the same question on SO, check out this answer and see if that helps.

    He added the following:

    mWebView.getSettings().setUseWideViewPort(true);
    

    Yeah It seems like the ViewPager consumes your horizontal scroll, check out these two solutions. Hopefully they help.

    • Solution 1
    • Solution 2
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

link Im having trouble converting the html entites into html characters, (&# 8217;) i
I've got a string that has curly quotes in it. I'd like to replace
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I want use html5's new tag to play a wav file (currently only supported
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
i got an object with contents of html markup in it, for example: string
I have a .ini file as follows: [playlist] numberofentries=2 File1=http://87.230.82.17:80 Title1=(#1 - 365/1400) Example
I have just tried to save a simple *.rtf file with some websites and
I want to count how many characters a certain string has in PHP, but
That's pretty much it. I'm using Nokogiri to scrape a web page what has

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.