【问题标题】:Gridview scroll widthGridview 滚动宽度
【发布时间】:2017-11-14 12:31:26
【问题描述】:

我有这个 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>

我正在尝试增加滚动宽度。我试过使用scrollbarSize,但没有任何改变。有没有办法在不自定义的情况下增加滚动条的宽度?

我是 Android 开发新手,所以请温柔:)

更新:测试了这个possible solution 并在滚动视图中添加了我的gridview

<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>

但是 gridview 要小得多,我看到的只是 gridview 细滚动。

【问题讨论】:

标签: android gridview


【解决方案1】:

请试试这个

android:scrollbarAlwaysDrawVerticalTrack=true

android:scrollbars=垂直

【讨论】:

  • 已经试过这个 android:fadeScrollbars="false" android:scrollbarStyle="outsideInset" android:scrollbarSize="30dp" android:smoothScrollbar="true" android:scrollbarAlwaysDrawVerticalTrack="true" android:scrollbars= “垂直” - 相同的结果 :(
【解决方案2】:

【讨论】:

    猜你喜欢
    • 2014-03-16
    • 2021-03-12
    • 2012-06-04
    • 2011-01-12
    • 1970-01-01
    • 2012-09-12
    • 2011-09-13
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多