0
如何檢測當您在UIImageView上滑動手指?例如說你滑過你的手指,它會改變顏色或其他東西。我希望能夠滑過多個UIImageView併發生某些事情...滑動手指UIImageView
如何檢測當您在UIImageView上滑動手指?例如說你滑過你的手指,它會改變顏色或其他東西。我希望能夠滑過多個UIImageView併發生某些事情...滑動手指UIImageView
嘗試使用UIScrollView
內的UIImageView
!
要檢測您在UIImageView
中的觸摸,必須重寫UIImageView
並將UserInteractionEnabled
設置爲YES
。然後你可以處理像touchesBegan
和touchesEnded
這樣的事件。
UIImageWithTouchControl.h
@interface UIImageWithTouchControl : UIImageView
UIImageWithTouchControl.m
-(void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event
{
}
-(void)touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event
{
}