千万不要把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!

11 thoughts on “千万不要把Listview放在ScrollView里

  1. Pingback: Android 组件: SectionedAdapter | lytsing's Blog

  2. QQ

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

    Reply
  3. Pingback: 新浪微博Android客户端实战 – 查看详细微微博信息 | lytsing's Blog

  4. whatsapp

    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?

    Reply
  5. Pingback: 如何在ScrollView嵌套另一个ScrollView? - Android - 开发者第957478个问答

  6. zym

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

    Reply
  7. Pingback: [教程]Android开发-自制控件(View)实现简单的ListView功能 – Jerry Locke's Blog

Leave a Reply

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