我已经阅读并尝试了所有关于从gridview中删除/隐藏滚动条的stackoverflow问题,但是它不会消失!我正在测试一个运行棒棒糖的三星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>
这是我的
onCreate
llChooserContainer.setVerticalScrollBarEnabled(false);
llChooserContainer.setHorizontalScrollBarEnabled(false);
gvGallery.setOnItemClickListener(this);
gvGallery.setVerticalScrollBarEnabled(false);
gvGallery.setHorizontalScrollBarEnabled(false);
gvGallery.setAdapter(imagesAdapter);
也尝试设置样式,如
gvGallery.setScrollBarStyle(View.SCROLLBARS_OUTSIDE_OVERLAY);
并将大小设置为空:
gvGallery.setScrollBarSize(0);
拇指指向空
android:scrollbarThumbHorizontal="@null"
android:scrollbarThumbVertical="@null"
xml->styles.xml中没有任何内容,我还尝试清理项目、使缓存失效、每次卸载应用程序。
最佳答案
尝试此操作,从GridView中删除以下属性:
android:fastScrollEnabled="true"