Android ListView How to set the height of item

Source: Internet
Author: User

Wirelessly's ListView, setting its height to display the item layout is undesirable to set the height of item displayed in the ListView. How do I set the height of item?

There are two types of situations:

1. There are pictures of the situation:

The picture is relatively simple, the size of the layout will be the size of the picture to prop up, it is only necessary to adjust the width and height of the picture.

2. No picture situation

Without pictures we can determine the size in two ways

A. Use android:minheight= "5DP" in the layout to fill in the required minimum height, which is convenient and direct.

B. If you are writing in your own adapter, then you can add these two lines of code in the GetView () method

Android ListView How to set the height of item

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.