How can I add blank space to the end of a ListView?

后端 未结 5 1967
一生所求
一生所求 2021-01-04 05:26

I have a number of elements in a ListView that scroll off the screen.

I would like there to be blank space at the end of the View. That is, the user should be able

5条回答
  •  小鲜肉
    小鲜肉 (楼主)
    2021-01-04 06:01

    The accepted answer is too complicated, and addFooterView is not for this kind of thing. The proper and simpler way is to set the paddingTop and paddingBottom, and you need to set clipToPadding to "false". In your list view or grid view, add the following:

        android:paddingTop="100dp"
        android:paddingBottom="100dp"
        android:clipToPadding="false"
    

    You'll get blank space at the top and the bottom that moves with your finger scroll.

提交回复
热议问题