많은 행 (~ 100)을 가진 UIScrollView가 있으며 빠른 할당 및 하위 뷰 (행) 추가를 위해 dequeueReusableRow 메소드가 구현되었습니다. 모든 것이 잘 작동하지만 스크롤이 아주 빠르면 일부보기가 감속되어 나중에 scrollView에 추가되지 않습니다.스크롤하는 동안 UIScrollView에 서브 뷰 (행)를 빠르게 추가하십시오.
- (UIView *)dequeueReusableRow
{
UIView *view = [reusableRows anyObject];
if(view)
{
[[view retain] autorelease];
[reusableRows removeObject:view];
}else{
view = [[UIView alloc] init....
}
return view;
}
- (void)addVisibleRows
{
UIView *row = [self dequeueReusableRow];
row.frame = ....
[scrollView addSubview:row]
}
- (void)scrollViewDidScroll:(UIScrollView *)scrollView
{
[self addVisibleRows];
[self removeInvisibleRows];
}
, 같은 아코디언의 구조가 보이기 때문에 내가 jQuery과 사용 제안하지 마십시오 :
section
- section
-- section
--- row
- section
section
- row
addVisibleRows
전에 호출합니다. http://stackoverflow.com/questions/1944428/how-to-implement-an-accordion-view-for-an-iphone-sdk-app – jrturton