我在滚动视图中有一个图像视图,并且我正在使用页面控件来滚动图像。问题只是最后一个图像不显示前两个图像。但是当我滚动时,我可以看到第二个图像扩展一些然后消失。如何解决这个问题。
问问题
286 次
1 回答
2
memberScrollview=[[UIScrollView alloc]initWithFrame:memberScrollviewFrame];
memberScrollview.pagingEnabled=YES;
memberScrollview.backgroundColor = [UIColor colorWithRed:0.95 green:0.95 blue:0.95 alpha:0.2];
memberScrollview.showsVerticalScrollIndicator=NO;
memberScrollview.showsHorizontalScrollIndicator=NO;
memberScrollview.delegate =self;
memberScrollview.scrollEnabled = YES;
int scrollength = 50;
memberScrollview.contentSize = CGSizeMake(scrollength,60);
memberImageArray =[[NSMutableArray alloc]init];
memberScrollViewImageArray=[[NSArray alloc]initWithObjects:kmemberScrollViewImageArray];
leftValue =0;
for (int j=0; j<12; j++){
if (j%3 == 0) {
y = float2;
}
else if (j % 3 == 1) {
//x = 32;
y = float32;
}
else if(j % 3 == 2) {
//x = 62;
y = float62;
// leftValue += 30;
}
profileImageViewFrame=CGRectMake(x,y,float28,float28);
profileImageView=[[UIImageView alloc]initWithFrame:profileImageViewFrame];
profileImageView.image=[UIImage imageNamed:[memberScrollViewImageArray objectAtIndex:j]];
[memberImageArray insertObject:profileImageView atIndex:j];
profileImageView.backgroundColor = [UIColor clearColor];
memberScrollview.contentSize=CGSizeMake(x+float30,float90);
[memberScrollview addSubview:[memberImageArray objectAtIndex:j]];
if(j % 3 == 2) {
x = x+float30;
}
}
[thirdView addSubview:memberScrollview];
于 2012-08-30T07:29:41.727 回答