无法从GridView中删除滚动条

J. *_* K. 2 android gridview

我已经阅读并尝试了有关从gridview中删除/隐藏滚动条的所有stackoverflow问题,但是,它不会消失!我正在运行棒棒糖的Samsung Galaxy S4上进行测试。

这是我的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>
Run Code Online (Sandbox Code Playgroud)

这是我的 onCreate

    llChooserContainer.setVerticalScrollBarEnabled(false);
    llChooserContainer.setHorizontalScrollBarEnabled(false);
    gvGallery.setOnItemClickListener(this);
    gvGallery.setVerticalScrollBarEnabled(false);
    gvGallery.setHorizontalScrollBarEnabled(false);
    gvGallery.setAdapter(imagesAdapter);
Run Code Online (Sandbox Code Playgroud)

还尝试过设置样式,例如

    gvGallery.setScrollBarStyle(View.SCROLLBARS_OUTSIDE_OVERLAY);
Run Code Online (Sandbox Code Playgroud)

并将size设置为null:

    gvGallery.setScrollBarSize(0);
Run Code Online (Sandbox Code Playgroud)

和拇指为空

android:scrollbarThumbHorizontal="@null"
android:scrollbarThumbVertical="@null"
Run Code Online (Sandbox Code Playgroud)

XML中没有任何内容-> styles.xml我也尝试过清理项目,使缓存无效,每次都卸载应用程序。

在此处输入图片说明

Arj*_*ini 6

你可以试试看

    android:fadeScrollbars="false"
Run Code Online (Sandbox Code Playgroud)

要么

    android:scrollbarThumbVertical="@android:color/transparent"
Run Code Online (Sandbox Code Playgroud)