滚动列表视图中的不同单元格高度 [英] scrolling in listview with different cell height

查看:157
本文介绍了滚动列表视图中的不同单元格高度的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个列表视图和它的行具有不同的高度。

当我向上滚动,行出现不正常向上或向下移动。
(我不觉得行为,当我向下滚动)

我怀疑它是由于这样的事实:

  
      
  1. 在ListView中挑选用于行之一
  2.   
  3. 在该行被放置在可见的行之上。
  4.   
  5. 的ListView改变行的高度(此处无规律的运动)
  6.   

但它是一个猜测。

我想谷歌搜索,因为这应该是一个普遍的问题,但找不到任何。

解决方案

在这种情况下,制定正确的项目高度的伎俩:

<一个href="http://stackoverflow.com/questions/7512592/how-to-set-different-heights-for-each-row-in-a-listview">How在一个ListView设置不同高度的每一行?

编辑:哦,一定要正确地回收项目:

<一个href="http://stackoverflow.com/questions/6921462/listview-reusing-views-when-i-dont-want-it-to">ListView重用视图时......我不希望它

I have a listview and its rows have different heights.

When I scroll up, rows appear to move up or down erratically.
(I don't find the behavior when I scroll down)

I suspect its due to the fact

  1. listView picks one of used rows
  2. the row is placed on top of visible rows.
  3. listView changes the row's height(here erratic movement)

but it's a guess.

I tried googling since this should be a common problem but couldn't find any.

解决方案

In this case, setting the right item height did the trick :

How to set different heights for each row in a ListView?

Edit: oh, and make sure you recycle the items correctly :

ListView reusing views when ... I don't want it to

这篇关于滚动列表视图中的不同单元格高度的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆