Coder Social home page Coder Social logo

popupmenu's Introduction

PopupMenu

QQ菜单、微信 右上角+号==按钮弹出的可变菜单, 在别人的基础上做了完善,称之为DavidPopupMenu。简称DP,有兴趣的可以用一下。


Author 崔盛希
E-mail [email protected]

效果图:


###使用方法

- (IBAction)sender:(UIButton *)sender {
if (!sender.selected) {

NSArray*menuArr=@[
[PopupMenuItem menuItem:@"" image:[UIImage imageNamed:@"hyq"] target:self action:@selector(menuClick:)],
[PopupMenuItem menuItem:@"" image:[UIImage imageNamed:@"hyq"] target:self action:@selector(menuClick:)],
[PopupMenuItem menuItem:@"" image:[UIImage imageNamed:@"hyq"] target:self action:@selector(menuClick:)],
[PopupMenuItem menuItem:@"" image:[UIImage imageNamed:@"hyq"] target:self action:@selector(menuClick:)],
[PopupMenuItem menuItem:@"" image:[UIImage imageNamed:@"hyq"] target:self action:@selector(menuClick:)]];
[Popup setTitleFont:[UIFont systemFontOfSize:15]];
OptionalConfiguration options=DavidOptionalConfigurationMake(9, 7, 9, 25, true, false, 
true, true, false, DavidColorMake(0, 0, 0), DavidColorMake(1, 1, 1));
[Popup showMenuInView:self.view fromRect:sender.frame menuItems:menuArr withOptions:options]; //显示下拉菜单
}else{
[Popup dismissMenu]; //下拉菜单消失

}

}

-(void)menuClick:(PopupMenuItem*)sender{
NSLog(@"===%@",sender.title);
}

注意 使用的图片不能太大了(小于单行的高度),大了会超出!一般都是使用的小图标。有兴趣的,可以再优化了!

popupmenu's People

Stargazers

 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.