You can use android:clipToPadding=false
to add padding that doesn't stay when the items are scrolled.
(您可以使用android:clipToPadding=false
添加滚动项目时不会保留的填充。)
Like this (像这样)
<GridView
android:id="@+id/grid"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:horizontalSpacing="16dp"
android:verticalSpacing="16dp"
android:padding="16dp"
android:clipToPadding="false" />
And if you want the scrollbar on the outside of the padding area, set android:scrollbarStyle="outsideOverlay"
thanks @Karl!
(如果您希望滚动条位于填充区域的外部,请设置android:scrollbarStyle="outsideOverlay"
谢谢@Karl!)
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…