Categories
Android

千万不要把Listview放在ScrollView里

晚上逛了一下 eoe android论坛,见到一坨人千方百计的把ListView弄到ScrollView,还研究出一些策略,并引以为豪。eoe market也是用这样的设计,滚动条显示很诡异,时长时短。ListView 本来是不应该 放在 ScrollView 里的,Google员工 Roman Guy早已回复:“There is no need to put a ListView in a ScrollView since ListView already supports scrolling. Do NOT put a ListView inside a ScrollView. ListView already handles scrolling, you’re only going to run into trouble. “ 更详细的,大家可以看看他在 google i/o 上的ListView视频讲解。大家不要抱着侥幸的心理,要用正确的方法去做正确的事情。如果真的需要ListView不同行显示这样的设计,可以参考Mark Murphy提供的http://github.com/commonsguy/cwac-merge

If you enjoyed this post, make sure you subscribe to my RSS feed!

10 replies on “千万不要把Listview放在ScrollView里”

有的時候是不得已的….設計常常會堅持他們自己搞出來的無俚頭想法….RD只有苦幹的份….

Thanks for the auspicious writeup. It in fact was once a amusement account it.
Look complex to far delivered agreeable from you!
However, how could we communicate?

ScrollView不能包含ListView,那ScrollView设计是用来干什么的?这种设计是不是狗屎的缺陷啊?ScrollView处理页面滚动,却得自己处理所包含子控件的高度?还得选择性的包含子控件?

Leave a Reply to QQ Cancel reply

Your email address will not be published. Required fields are marked *