これは私のコードです
ここでは、画像をスワイプしながらサウンドを追加したいと思います。
int x,y,count;
but=[[NSMutableArray alloc]initWithObjects:[UIImage imageNamed:@"top2.png"],[UIImage imageNamed:@"top1.png"],[UIImage imageNamed:@"top3.png"],[UIImage imageNamed:@"top4.png"],[UIImage imageNamed:@"top5.png"],[UIImage imageNamed:@"top6.png"],[UIImage imageNamed:@"top7.png"],[UIImage imageNamed:@"top8.png"],nil];
x=0;
y=0;
count=0;
for (int i=0; i<=7; i++) {
count++;
for (int i=7; i>=0; i--) {
count--;
UIButton *but2=[[UIButton alloc]initWithFrame:CGRectMake(x, y, 320, 141)];
//[but setImage:[UIImage imageNamed:@"mzl.jpg" ]forState:UIControlStateNormal];
[but2 setImage:[but objectAtIndex:i] forState:UIControlStateNormal];
NSLog(@"%@",but);
x=x+320;
// x=0;
//y=0;
if(count==8)
{
//count++;
}
//[scr addSubview:images];
//[images release];
[scrollview1 addSubview:but2];
}
}
scrollview1.pagingEnabled=TRUE;
[scrollview1 setContentSize:CGSizeMake(x, y)];