Giter Club home page Giter Club logo

aybubbleview's Introduction

AYBubbleView

仿qq的可拖拽未读气泡

介绍

模仿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
    }
};

初始化的时候配置bubble的中心点坐标、半径和父视图。

decayCoefficient:衰减系数,0~1,值越大,可拉伸的距离越大。

unreadLabel:中间显示的未读数,可自行配置font,color等。

bubbleColor:气泡的颜色

cleanMessageBlock:清除消息的时候进行回调操作。

显示和隐藏

当需要显示气泡的时候调用下面的方法

[self.bubbleView showBubbleView];

当需要隐藏气泡的时候调用下面的方法

[self.bubbleView hidenBubbleView];

aybubbleview's People

Contributors

ayjk avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.