The Footview of the ListView keeps getting longer.

Source: Internet
Author: User

A word: Ya Addfootview executed several times, go back to modify the conditions, Footview already exist when you don't add ~ ~ ~ Don't understand please see the last ~ ~

Troubleshooting Order:

1, write a test project alone, simple Listview,getview return a textview,addfootview after the interface normal

2, modify the official project, GetView also modified to return TextView, the problem exists ~ ~

========================

Horse eggs I only use TextView also reported wrong, don't let live!!

Suddenly found that the footview each move down the size of the same, it is repeated added ~

Sure enough to add again ~ ~ ~

========================

The premise of the problem arises:

Private View Footview = View.inflate (Context,r.id.footview,null), .... private void Updatelistview () {if (Hasmoredata) Li    Stview.addfooterview (Footview); else Listview.removefooterview (Footview);}

That is , Updatelistview is executed several times, the same view is repeated add, the problem of this ghost will appear.

Modify the judging condition:

(!hasmoredata) {Listview.removefooterview (footview);} (Listview.getfooterviewscount () = =) {. Listviewaddfooterview (Footview);}

Problem solving.

The Footview of the ListView keeps getting longer.

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.