向 Android TouchListView 添加页脚
您好,我正在使用这里的 TouchListView 控件: https://github.com/commonsguy/cwac-touchlist< /a> 我添加了一些按钮来添加到页脚中的列表:
mFooter = getLayoutInflater().inflate(R.layout.edit_homepage_footer_layout, null);
mListView = (TouchListView) findViewById(R.id.sectionList);
mListView.addFooterView(mFooter);
一切似乎都工作正常,直到我拖动列表中的一项,此时页脚折叠(我认为是一个列表项的高度)模糊我添加的按钮。
任何人都可以为此建议修复/解决方法吗?
Hi I'm using the TouchListView control from here: https://github.com/commonsguy/cwac-touchlist
and I've added some buttons to add to the list in the footer:
mFooter = getLayoutInflater().inflate(R.layout.edit_homepage_footer_layout, null);
mListView = (TouchListView) findViewById(R.id.sectionList);
mListView.addFooterView(mFooter);
It all seems to be working fine until I drag an item in the list, at which point the footer collapses (to the height of one list item I think) obscuring the buttons I have added.
Can anyone suggest a fix/workaround for this?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
实际上,我在询问后不久就解决了这个问题(总是这样......)
问题出在 doExpansion() 和 unExpandViews() 方法中,它们修改了列表中的每个项目,包括页脚。为了解决这个问题,我创建了一个方法来检查我们是否正在处理可拖动项目或页脚:
然后修改了提到的方法,如下所示:
我认为值得更新 github 项目以包含此内容。
I actually worked this out shortly after asking it (always the way...)
The issue is in the doExpansion() and unExpandViews() methods which were modifying every item in the list including the footer. To fix it I created a method to check whether we are dealing with a draggable item or the footer:
And then modified the methods mentioned as follows:
Would be worth updating the github project to include this I think.