How to add a scroll bar in a phone call application

I am developing an application in PhoneGap for the Android platform.

In this application, the scroll bar is not displayed. How can I display the scroll bar in my application?

+2
source share
5 answers

Here is my example Activity in which scrollbars will be displayed

public class MyActivity extends DroidGap {

    @Override
    public void onCreate(Bundle savedInstanceState) {

        super.onCreate(savedInstanceState);

        super.loadUrl("file:///android_asset/www/index.html");

        // Display vertical scrollbar and hide horizontal scrollBar
        super.appView.setVerticalScrollBarEnabled(true);
        super.appView.setHorizontalScrollBarEnabled(false);
        // set scrollbar style
        super.appView.setScrollBarStyle(View.SCROLLBARS_INSIDE_OVERLAY);
    }

}
+5
source

well scrolling - , phonegap/cordova, , . , , iscroll 4. , google- iscroll4 , jquery-mobile, phonegap.

+2
0

. - CordovaWebView.java, plugin, JavaScript :

mayflower.AndroidScrollbar.toggleVerticalScrollbarVisibility(true)
.then(
    function() {
        console.log('Vertical scrollbar enabled');
    }
);
0

Cordova 5.2+ . :

  • : SystemWebViewEngine.java, yourAppName\\Android\CordovaLib\Src\\Apache\Cordova\SystemWebViewEngine.java

  • :

    webView.setVerticalScrollBarEnabled();

, Pal!

0

Source: https://habr.com/ru/post/1524847/


All Articles