を含むUIView
という名前のプロパティがあります。をアニメーション化すると(タップすると表示され、徐々に消えていきます)、 がタッチに反応しません。私が使用しているコードは次のとおりです。viewToFade
UISegmentedControl
UIView
UISegmentedControl
-(void)fadeView
{
self.viewToFade.alpha=1;
self.viewToFade.hidden=NO;
//When I comment the following lines out, everything is fine--the `UISegmentedControl` responds as it should.
//But when I include them, the `UISegmentedControl` doesn't register changes/taps.
[UIView animateWithDuration:0.3
delay: 3.0
options:UIViewAnimationOptionAllowUserInteraction
animations:^{
self.viewToFade.alpha = 0.0;
}
completion:nil];
}
私は何を間違っていますか?
(関連がある場合は、 xib ファイルでUIView
と のUISegmentedControl
両方が作成されていると言います。)
編集:私は問題に対処する方法を考え出しました。それは、次のようにコードを書き直すことでした:
-(void)fadeView
{
self.viewToFade.alpha=1;
self.viewToFade.hidden=NO;
[self performSelector:@selector(disneyfy) withObject:nil afterDelay:(3)];
}
-(void)disneyfy
{
[UIView animateWithDuration:0.3
animations:^{
self.viewToFade.alpha = 0.0;
}];
}