One reason that the Android GetView method does not perform is that there is no location in the layout file to display the list

Source: Internet
Author: User

One reason is that there is no location in the layout file to show the list.

For example: The following layout

<com.xxx.view.baselistview
Android:id= "@+id/list_find"
Android:layout_width= "Match_parent"
android:layout_height= "Match_parent"
Android:cachecolorhint= "@android: Color/transparent"
android:divider= "@drawable/base_horizontal_line"
android:dividerheight= "1DP"
Android:fadingedgelength= "0DP"
Android:fastscrollenabled= "true"
android:paddingbottom= "10DP"/>

<com.xxx.view.baselistview
Android:id= "@+id/list_article"
Android:layout_width= "Match_parent"
android:layout_height= "Match_parent"
Android:cachecolorhint= "@android: Color/transparent"
android:divider= "@drawable/base_horizontal_line"
android:dividerheight= "1DP"
Android:fadingedgelength= "0DP"
Android:fastscrollenabled= "true"
android:paddingbottom= "10DP"/>

The first name is List_find's view height is match_parent, has filled the space, resulting in the first name of the List_article view does not show the space, so that the view does not execute GetView method, the data is not displayed.


Also, if the getcount result of view is 0, the GetView method is not executed.

One reason that the Android GetView method does not perform is that there is no location in the layout file to display the list

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.