Android implementation ListView or GridView first row/last line distance from screen edge

Source: Internet
Author: User

Listview&gridview default lines on Android are pinned, which can be ugly.

In general to solve this problem will be in the first line or tail line with a hidden view, so it is too troublesome. It's really useful to see this property when you look at a blog online!

Directly on the key properties:

Set android:cliptopadding = True for the ListView or GridView

Then set the distance through Paddingtop and paddingbottom.


Blog Original:

Http://www.cnblogs.com/xitang/p/3606578.html

1.clipChild is used to define whether his child controls should be drawn within the bounds he should have. By default, Clipchild is set to true. That is, the extended drawing is not allowed.

2. Cliptopadding is used to define whether ViewGroup is allowed to be drawn in padding. By default, Cliptopadding is set to ture, which means that the values in the padding are trimmed.

And this feature is a method already available on Android's first version . All can be used across any Android version.



Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.