0
UIScrollView
に10 UIButtons
が追加されました。 UIAnimation
を使用してスクロールビューコードを自動的にスクロールします。アニメーション表示時にスクロール表示ボタンの動作が機能しない
for (int i=0; i<10; i++) {
UIButton *button = [UIButton buttonWithType:UIButtonTypeCustom];
button.frame = CGRectMake(XPosition, YPosition, width,50);
[button setTitle:@"Warning animation items array " forState:UIControlStateNormal];
button.tag = i;
[button addTarget:self action:@selector(buttonAction:) forControlEvents:UIControlEventTouchUpInside];
if (index%2) {
button.backgroundColor = [UIColor blueColor];
} else{
button.backgroundColor = [UIColor purpleColor];
}
XPosition = paddingSpace + XPosition + button.frame.size.width;
[_scroll addSubview:button];
index++;
}
_scroll.contentSize=CGSizeMake(XPosition,50);
UIScrollView
をアニメーション化するとき、私はできないことはできタップ任意のUIButton
!
[UIView animateWithDuration:20
delay:0.0
options:(UIViewAnimationOptionAllowUserInteraction | UIViewAnimationOptionRepeat)
animations:^{
_scroll.contentOffset = CGPointMake(XPosition, 0.0);
} completion:^(BOOL finished){}];
アニメーションが停止のみの場合は、UIButton
をタップできます。
私を助けてください。
あなたのアニメーションのコードを入れてください。 –
10個のボタンでスクロールビューを使用できる理由あなたは同じボタンが良い方法です再利用でtableviewを使用できますか?コードを共有する –
縦方向に繰り返しスクロールする必要があります。スクロールをアニメートするときにタップする必要があります –