グリッドビューからスクロールバーを削除/隠すことに関するすべてのstackoverflow質問を読み、試しましたが、消えません!私はLollipopを実行している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>
ここに私のonCreate
llChooserContainer.setVerticalScrollBarEnabled(false);
llChooserContainer.setHorizontalScrollBarEnabled(false);
gvGallery.setOnItemClickListener(this);
gvGallery.setVerticalScrollBarEnabled(false);
gvGallery.setHorizontalScrollBarEnabled(false);
gvGallery.setAdapter(imagesAdapter);
もnullに
gvGallery.setScrollBarStyle(View.SCROLLBARS_OUTSIDE_OVERLAY);
と設定サイズなどのスタイルを設定しようとした:
gvGallery.setScrollBarSize(0);
と親指
android:scrollbarThumbHorizontal="@null"
android:scrollbarThumbVertical="@null"
をnullにXMLには何もありません - >のstyles.xml私も、プロジェクトをクリーニングするキャッシュを無効に、アプリを毎回アンインストールしようとしました。
ます。http:// stackoverflowの。 com/questions/4852867/ho w-to-disable-gridview-in-android –
「fastScrollEnabled」を削除すると最終的に私の問題が解決されました!ありがとうございました!あなたはそれを答えとして追加することができます –
私はあなたのために働くit.ifを受け入れてください以下の私の答えを追加します –