0
我已阅读并尝试了有关从gridview中删除/隐藏滚动条的所有stackoverflow问题,但是,它不会消失!我正在测试运行棒棒糖的三星Galaxy S4。无法从gridview中删除滚动条
这里是我的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);
,并设置大小设置样式为null:
gvGallery.setScrollBarSize(0);
和拇指空
android:scrollbarThumbHorizontal="@null"
android:scrollbarThumbVertical="@null"
没有什么在XML - > styles.xml我也试过清洁工程,无效缓存,每次卸载应用程序。
的http://计算器。 COM /问题/ 4852867/HO w-to-disable-gridview-scroll-in-android –
删除'fastScrollEnabled'终于解决了我的问题!谢谢!您可以添加,作为答案 –
我在下面添加我的答案,请接受它。如果它适合你 –