仿qq未读消息的拖拽效果
查看次数:5185
下载次数:685
上传时间:2016-04-03
大小:19 B
仿qq未读消息的拖拽效果
github地址:https://github.com/AYJk/AYBubbleView,喜欢的请点个star哦。谢谢啦。
blog地址:http://ayjkdev.top/2016/04/03/bubbleview-like-qq/ 里面有比较的分析介绍。
初始化:
self.bubbleView = [[AYBubbleView alloc] initWithCenterPoint:self.view.center bubleRadius:15 addToSuperView:self.view];
self.bubbleView.decayCoefficent = .2;
self.bubbleView.unReadLabel.text = @"1";
self.bubbleView.bubbleColor = [UIColor redColor];
__weak typeof(self) weakSelf = self;
self.bubbleView.cleanMessageBlock = ^(BOOL isClean) {
if (isClean) {
weakSelf.messageSteper.value = 0;
} else {
// do other logical operation
}
};
当需要显示气泡的时候调用下面的方法
[self.bubbleView showBubbleView];
当需要隐藏气泡的时候调用下面的方法
[self.bubbleView hidenBubbleView];
超出一定范围会自动隐藏,可通过block回调继续逻辑操作。
超出一定范围后或未超过范围,气泡会自动回弹。
收藏