现在的位置: 首页 > 综合 > 正文

【iOS】UIImageView点击是现实高亮图,放手时现实默认图

2019年05月29日 ⁄ 综合 ⁄ 共 467字 ⁄ 字号 评论关闭

让UIImageView点击是现实高亮图,放手时现实默认图!

方法如下

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

{
    _bubbleBg.highlighted = YES;
    CarmenLog(@"touchesBegan");
    
}
- (void)touchesMoved:(NSSet *) touches withEvent:(UIEvent *) event

{
    CarmenLog(@"touchesMoved");
}
- (void)touchesEnded:(NSSet *) touches withEvent:(UIEvent *) event
{
    CarmenLog(@"touchesEnded");
}
- (void)touchesCancelled:(NSSet *) touches withEvent:(UIEvent *) event
{
     _bubbleBg.highlighted = NO;
    CarmenLog(@"touchesCancelled");
}

抱歉!评论已关闭.