2

I have read and tried all of the stackoverflow questions about removing/hiding a scrollbar from a gridview, however, it wont disappear! I am testing on a Samsung Galaxy S4 running Lollipop.

Here is my XML:

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:id="@+id/llChooserContainer"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:scrollbars="none"
    android:layout_marginTop="?android:attr/actionBarSize"
    android:orientation="vertical">

    <GridView
        android:id="@+id/gvGallery"
        android:layout_width="match_parent"
        android:layout_height="0dp"
        android:layout_weight="1"
        android:layout_margin="10dp"
        android:columnWidth="@dimen/chooser_grid_col_width"
        android:fadingEdgeLength="10dp"
        android:fastScrollEnabled="true"
        android:scrollbars="none"
        android:gravity="center"
        android:numColumns="auto_fit"
        android:requiresFadingEdge="vertical"
        android:scrollingCache="true"
        android:stretchMode="columnWidth"/>

</LinearLayout>

Here is my onCreate

    llChooserContainer.setVerticalScrollBarEnabled(false);
    llChooserContainer.setHorizontalScrollBarEnabled(false);
    gvGallery.setOnItemClickListener(this);
    gvGallery.setVerticalScrollBarEnabled(false);
    gvGallery.setHorizontalScrollBarEnabled(false);
    gvGallery.setAdapter(imagesAdapter);

Also tried setting styles like

    gvGallery.setScrollBarStyle(View.SCROLLBARS_OUTSIDE_OVERLAY);

and setting size to null:

    gvGallery.setScrollBarSize(0);

and thumb to null

android:scrollbarThumbHorizontal="@null"
android:scrollbarThumbVertical="@null"

There is nothing in the XML -> styles.xml I also tried cleaning the project, invalidating caches, uninstalling the app every time.

enter image description here

Pradeep Gupta
  • 1,770
  • 1
  • 9
  • 23
Kaloyan Roussev
  • 14,515
  • 21
  • 98
  • 180

2 Answers2

7

you can try this

    android:fadeScrollbars="false"

or

    android:scrollbarThumbVertical="@android:color/transparent"
Arjun saini
  • 4,223
  • 3
  • 23
  • 51
3

try this, remove the below property from gridview:

android:fastScrollEnabled="true"
Pradeep Gupta
  • 1,770
  • 1
  • 9
  • 23