添加额外的空间的GridView或ListView底部 [英] Add extra space to bottom of a GridView or ListView

查看:154
本文介绍了添加额外的空间的GridView或ListView底部的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否可以添加额外的空间(有点像一个空行)到一个GridView的底部?

Is it possible to add extra space (kinda like an empty row) to the bottom of a GridView?

我想它,所以当你向下滚动到GridView的底部,会出现空额外50dp。我试着设置 paddingBottom会来50dp,但似乎并没有改变任何东西。

I would like it so when you scroll down to the bottom of a GridView, there will be an extra 50dp of empty space. I tried setting paddingBottom to 50dp, but it didn't seem to change anything.

推荐答案

如果我理解你的权利,它应该是这样的:

If I understand you right, it should look like this:

有关,一个简单的解决方案是由马切伊这里提到:<一href=\"http://stackoverflow.com/questions/25788383/how-to-add-extra-space-inside-at-the-bottom-of-a-gridview\">How里面的一个GridView 的底部添加额外的空间。

For that an easy solution is mentioned here by Maciej: How to add extra space inside at the bottom of a GridView

您只需要添加如下在你的GridView布局:

You just need to add the following in your GridView Layout:

<GridView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingBottom="50dp"
android:clipToPadding="false"/>

最重要的部分是必须设置为false clipToPadding属性。

The most important part is the clipToPadding attribute which has to be set to false.

您还可以看到谷歌从,在这种解决方案中提到的根据博客文章:<一href=\"https://plus.google.com/+AndroidDevelopers/posts/LpAA7q4jw9M\">https://plus.google.com/+AndroidDevelopers/posts/LpAA7q4jw9M

You can also see the according blog post from Google, where this solution is mentioned: https://plus.google.com/+AndroidDevelopers/posts/LpAA7q4jw9M

这篇关于添加额外的空间的GridView或ListView底部的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆