Question

We are currently developing a "hybrid" app using Intel's App Framework (formerly jqMobi/appMobi), but we have run into a problem. The actual problem is that when running inside an Android WebView (on an actual Android device), the webpage shows a rather big scrollbar. Even if there is no content on the webpage, it still gives us the opportunity to scroll way down!

When using the browser on the Android device and visit the webpage, it is not scrollable, just like we want it.

Our html looks like this (see below)....as you can see there's nothing actual on the page! I really hope someone can help us out here...

<!DOCTYPE html>
<html>
<head>
    <title>Demo App</title>
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />

    <script type="text/javascript" src="js/appframework.min.js"></script>       
    <script type="text/javascript" src="js/appframework.ui.min.js"></script>

    <link rel="stylesheet" type="text/css" href="css/af.ui.min.css" />
</head>

<body>
</body>
</html>

The WebView is configured like this:

mWebView = (WebView) findViewById(R.id.activity_main_webview);

mWebView.setClickable(true);
mWebView.setFocusableInTouchMode(true);

mWebView.addJavascriptInterface(new WebAppInterface(MainActivity.this), "Android");

mWebView.setWebViewClient(new WebClientClass());
mWebView.setWebChromeClient(new WebChromeClass());

WebSettings webSettings = mWebView.getSettings();
webSettings.setJavaScriptEnabled(true);
webSettings.setLoadsImagesAutomatically(true);

Here is a link to a screenshot: Screenshot

Was it helpful?

Solution 2

Okay, I just seem to have solved the problem I was having... The problem was in the Android App and not in the Intel's App Framework.

In the manifest file, I wanted to change the theme for an activity, so I had the following code:

<activity
    android:name="nl.deburen.boodschappertje.MainActivity"
    android:label="@string/app_name" 
    android:theme="@android:style/Theme.NoTitleBar" > <!-- THIS LINE GENERATES THE PROBLEM -->
</activity>

Strange behavior, but nonetheless a solution for me... :) Thanks for the help!

OTHER TIPS

I think you have an old version of Intel AppFramework, try with the latest.

I do not see the issues on Android 4.4, Nexus5. I just replaced the AppFramework scripts with the link to latest CDN and tested the code:

<!DOCTYPE html>
<html>
<head>
    <title>Demo App</title>
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />

    <link rel="stylesheet" type="text/css" href="http://cdn.app-framework-software.intel.com/2.1/af.ui.css" />
    <link rel="stylesheet" type="text/css" href="http://cdn.app-framework-software.intel.com/2.1/icons.css" />
    <script type="text/javascript" charset="utf-8" src="http://cdn.app-framework-software.intel.com/2.1/appframework.ui.min.js"></script>

</head>

<body>
</body>
</html>
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top