0

I have this Gridview

<GridView
    android:id="@+id/gridview_example"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:layout_marginBottom="20dp"
    android:layout_marginLeft="45dp"
    android:layout_marginRight="45dp"
    android:layout_marginTop="35dp"
    android:layout_centerHorizontal="true"
    android:layout_centerInParent="true"
    android:numColumns="3"
    android:horizontalSpacing="10dp"
    android:verticalSpacing="10dp"
    android:fadeScrollbars="false"
    android:scrollbarStyle="outsideInset"
    android:scrollbarSize="30dp"
    android:smoothScrollbar="true">
</GridView>

for which I'm trying to increase the scroll width. I've tried using scrollbarSize but nothing changes. Is there a way to increase the width of the scrollbar without customizing it?

I'm new in Android development so please be gentle :)

Update: Tested this possible solution and added my gridview inside the scrollview

<ScrollView
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:layout_marginBottom="20dp"
    android:layout_marginLeft="45dp"
    android:layout_marginRight="45dp"
    android:layout_marginTop="35dp"
    android:layout_centerHorizontal="true"
    android:layout_centerInParent="true"
    android:layout_above="@+id/bottomMenu"
    android:scrollbarSize="50dip">
    <GridView
        android:id="@+id/gridview_holes"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:numColumns="3"
        android:horizontalSpacing="10dp"
        android:verticalSpacing="10dp">
    </GridView>
</ScrollView>

But the gridview is much more smaller and I'm seeing just the gridview thin scroll.

Phantômaxx
  • 37,901
  • 21
  • 84
  • 115
LAffair
  • 1,968
  • 5
  • 31
  • 60
  • 3
    Possible duplicate of [How can I change the width/thickness of a scrollbar?](https://stackoverflow.com/questions/20782499/how-can-i-change-the-width-thickness-of-a-scrollbar) – Harsh Patel Nov 14 '17 at 12:33
  • Tested that answer and for me it's not working. That's why I posted this question. I've added the scrollview and inside my gridview but the gridview it's much more smaller :( – LAffair Nov 14 '17 at 12:37
  • Try to customize your scrollbar ->https://stackoverflow.com/questions/28471090/how-to-customize-gridview-vertical-scrollbar – Harsh Patel Nov 14 '17 at 12:39

2 Answers2

0

please try this

android:scrollbarAlwaysDrawVerticalTrack=true

android:scrollbars=vertical

Community
  • 1
  • 1
Jayesh
  • 131
  • 5
  • Already tried this android:fadeScrollbars="false" android:scrollbarStyle="outsideInset" android:scrollbarSize="30dp" android:smoothScrollbar="true" android:scrollbarAlwaysDrawVerticalTrack="true" android:scrollbars="vertical" -Same result :( – LAffair Nov 14 '17 at 12:49
0

use Scrollview for scrolling sub view

https://developer.android.com/reference/android/widget/ScrollView.html

Shomu
  • 2,734
  • 24
  • 32