iPhone 上实现页面循环滚动
2010-03-10 16:10:00 来源:WEB开发网{
// NSLog(@"error calucate of page index");
int a=0;a=1/a;
}
// NSLog(@"排序中 把pView=%d插入 %d 位置",pView, pageIndex-1);
[aryOrderd replaceObjectAtIndex:(pageIndex-1) withObject:pView];
}
}
[aryTemp release];
//排完后开始整体挪动位置
if(x < minStart)
{
NSLog(@"-----------------------need left round");
//头位置放到最后,其他位置左移
for (i=0; i
{
UIView* pView = [aryOrderd objectAtIndex:i];
if(i==(aryOrdredSize-1))
{
CGPoint centerPt = pView.center;
centerPt.x = perWidth/2;
pView.center = centerPt;
}
else
{
CGPoint centerPt = pView.center;
centerPt.x += perWidth;
pView.center = centerPt;
}
NSLog(@"================pView.center.x = %f",pView.center.x);
}
}
if(x >maxStart)
{
//末尾位置放到前,其他位置右移
NSLog(@"-----------------------need right round");
for (i=0; i
{
UIView* pView = [aryOrderd objectAtIndex:i];
if(i==0)
{
CGPoint centerPt = pView.center;
centerPt.x = totalWidth - perWidth/2;
pView.center = centerPt;
}
else
{
CGPoint centerPt = pView.center;
centerPt.x -= perWidth;
pView.center = centerPt;
}
NSLog(@"================pView.center.x = %f",pView.center.x);
if(pView.center.x > totalWidth )
{
int a=2;
a++;
}
}
}
}
[aryOrderd release];
更多精彩
赞助商链接