就像假设当我滚动图库时,中间的按钮将比另一个按钮向上移动 5px 所以无论中间出现什么按钮,它都会比其他按钮向上移动一点点。所以请帮助我
scrlview=[[UIScrollView alloc]initWithFrame:CGRectMake(0, 350, 320, 130)];
[scrlview setContentSize:CGSizeMake(600, 0)];
scrlview.delegate=self;
scrlview.backgroundColor=[UIColor blueColor];
scrlview.scrollsToTop=NO;
[self.view addSubview:scrlview];
btn1=[UIButton buttonWithType:UIButtonTypeRoundedRect];
btn1.frame=CGRectMake(10, 10, 55, 50);
[btn1 setTitle:@"Btn1" forState:UIControlStateNormal];
[scrlview addSubview:btn1];
btn2=[UIButton buttonWithType:UIButtonTypeRoundedRect];
btn2.frame=CGRectMake(70, 10, 55, 50);
[btn2 setTitle:@"Btn2" forState:UIControlStateNormal];
[scrlview addSubview:btn2];
btn3=[UIButton buttonWithType:UIButtonTypeRoundedRect];
btn3.frame=CGRectMake(130, 10, 55, 50);
[btn3 setTitle:@"Btn3" forState:UIControlStateNormal];
[scrlview addSubview:btn3];
btn4=[UIButton buttonWithType:UIButtonTypeRoundedRect];
btn4.frame=CGRectMake(190, 10, 55, 50);
[btn4 setTitle:@"Btn4" forState:UIControlStateNormal];
[scrlview addSubview:btn4];
btn5=[UIButton buttonWithType:UIButtonTypeRoundedRect];
btn5.frame=CGRectMake(250, 10, 55, 50);
[btn5 setTitle:@"Btn5" forState:UIControlStateNormal];
[scrlview addSubview:btn5];
btn6=[UIButton buttonWithType:UIButtonTypeRoundedRect];
btn6.frame=CGRectMake(310, 10, 55, 50);
[btn6 setTitle:@"Btn6" forState:UIControlStateNormal];
[scrlview addSubview:btn6];
btn7=[UIButton buttonWithType:UIButtonTypeRoundedRect];
btn7.frame=CGRectMake(370, 10, 55, 50);
[btn7 setTitle:@"Btn7" forState:UIControlStateNormal];
[scrlview addSubview:btn7];
btn8=[UIButton buttonWithType:UIButtonTypeRoundedRect];
btn8.frame=CGRectMake(430, 10, 55, 50);
[btn8 setTitle:@"Btn8" forState:UIControlStateNormal];
[scrlview addSubview:btn8];
btn9=[UIButton buttonWithType:UIButtonTypeRoundedRect];
btn9.frame=CGRectMake(490,10, 55, 50);
[btn9 setTitle:@"Btn9" forState:UIControlStateNormal];
[scrlview addSubview:btn9];