Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to add scroll bar in a phonegap application

I'm developing an application in PhoneGap for the Android platform.

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

like image 202
Preet_Android Avatar asked Nov 29 '25 16:11

Preet_Android


1 Answers

Here is my example Activity that will display the scrollbars

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);
    }

}
like image 87
lampgeek314 Avatar answered Dec 02 '25 06:12

lampgeek314



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!