0

UIImageView で指をスライドさせたとき、どのように検出しますか? たとえば、その上で指をスライドさせると、色か何かが変わるとします。複数の UIImageView にまたがってスライドして、何かを起こせるようにしたい...

4

1 に答える 1

0

で試してみてUIImageViewくださいUIScrollView

a でタッチを検出するには、 aUIImageViewを書き換えてUIImageViewに設定UserInteractionEnabledする必要がありますYEStouchesBeganその後、 やのようなイベントを処理できますtouchesEnded

UIImageWithTouchControl.h

@interface UIImageWithTouchControl : UIImageView

UIImageWithTouchControl.m

-(void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event
{
}

-(void)touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event
{
}
于 2010-05-05T13:57:45.397 に答える