Coder Social home page Coder Social logo

zxscirclemenu's Introduction

ZXSCircleMenu

介绍

使用

  • 添加菜单按钮
    ZXSCircleMenu *button = [[ZXSCircleMenu alloc] zxs_initWithFrame:CGRectMake(150, 200, 50, 50) normalIcon:@"icon_menu" selectedIcon:@"icon_close" buttonsCount:4 duration:4 distance:120];
    button.backgroundColor = [UIColor lightGrayColor];
    button.delegate = self;
    button.layer.cornerRadius = button.frame.size.width * 0.5;
    [self.view addSubview:button];
  • 实现菜单按钮代理方法
    #pragma mark - ZXSCircleMenuDelegate
    - (void)zxs_circleMenu:(ZXSCircleMenu *)circleMenu buttonWillDisplay:(ZXSCircleMenuButton *)button atIndex:(NSUInteger)index {

    NSLog(@"buttonWillDisplay:%zd",index);
    NSDictionary *tempdict = self.buttonArray[index];
    button.backgroundColor = (UIColor *)[tempdict valueForKey:@"color"];
    [button setImage:[UIImage imageNamed:[tempdict valueForKey:@"icon"]] forState:UIControlStateNormal];
    button.tintColor = [UIColor colorWithRed:0 green:0 blue:0 alpha:0.3];
    }

    - (void)zxs_circleMenu:(ZXSCircleMenu *)circleMenu buttonWillSelected:(ZXSCircleMenuButton *)button atIndex:(NSUInteger)index {
    NSLog(@"buttonWillSelected:%zd",index);
    }

    - (void)zxs_circleMenu:(ZXSCircleMenu *)circleMenu buttonDidSelected:(ZXSCircleMenuButton *)button atIndex:(NSUInteger)index {
    NSLog(@"buttonDidSelected:%zd",index);
    }

    - (void)zxs_menuCollapsed:(ZXSCircleMenu *)circleMenu {
    NSLog(@"zxs_menuCollapsed");
    }

效果

ZXSCircleMenu

结后语

  • 如果你觉得不错,请点个星星吧,辛苦啦!谢谢。。。
  • QQ:1252935734 你要是对本框架有什么建议,欢迎加我QQ,希望与小伙伴们一起学习、成长!!!

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.