GithubHelp home page GithubHelp logo

xhr4469 / rfpopupmenu Goto Github PK

View Code? Open in Web Editor NEW

This project forked from wangruofeng/rfpopupmenu

0.0 2.0 0.0 424 KB

RFPopupMenu is popupMenu is support six pop directions.

License: Other

Objective-C 100.00%

rfpopupmenu's Introduction

RFPopupMenu

RFPopupMenu is popupMenu is support six pop directions. It is very easy to use!

It supports three types view.

  1. Only a image.
  2. Only a label.
  3. a image on left and a label on right.

Requirements

iOS7.0 and later.

Usage

  1. #import "RFPopupMenu.h".
  2. use + (instancetype)popupMenuWithItems:(NSArray<RFPopupMenuItem *> *)items; or - (instancetype)initWithItems:(NSArray<RFPopupMenuItem *> *)items; to initialize.
  3. set arrowHorizontalOffset if need to adjust arrow's position.
  4. use
- (void)showInView:(UIView *)view
        targetRect:(CGRect)targetRect
      popDirection:(RFMenuPopDirection)direction
          animated:(BOOL)animated;

method to show in a view.

below is sample code

RFPopupMenuItem *item1 = [[RFPopupMenuItem alloc] initWithTitle:@"扫一扫" image:[UIImage imageNamed:@"scan"] target:self action:@selector(itemClicked:)];
RFPopupMenuItem *item2 = [[RFPopupMenuItem alloc] initWithTitle:@"加好友" image:[UIImage imageNamed:@"add"] target:self action:@selector(itemClicked:)];
RFPopupMenuItem *item3 = [[RFPopupMenuItem alloc] initWithTitle:@"创建讨论组" image:[UIImage imageNamed:@"chat"] target:self action:@selector(itemClicked:)];
RFPopupMenuItem *item4 = [[RFPopupMenuItem alloc] initWithTitle:@"发送到电脑" image:[UIImage imageNamed:@"computer"] target:self action:@selector(itemClicked:)];
RFPopupMenuItem *item5 = [[RFPopupMenuItem alloc] initWithTitle:@"面对面传" image:[UIImage imageNamed:@"change"] target:self action:@selector(itemClicked:)];
RFPopupMenuItem *item6 = [[RFPopupMenuItem alloc] initWithTitle:@"收钱" image:[UIImage imageNamed:@"money"] target:self action:@selector(itemClicked:)];

self.popupMenu = [[RFPopupMenu alloc] initWithItems:@[item1, item2, item3, item4, item5, item6]];
self.popupMenu.arrowHorizontalOffset = 90.f;

[self.popupMenu showInView:self.view targetRect:_button3.frame popDirection:RFMenuPopDirectionTopRight animated:YES];

##Screenshot

(Screenshot)

Download

You can download binary release from the latest releases.

License

RFPopupMenu is released under the MIT license. See LICENSE for details.

rfpopupmenu's People

Contributors

wangruofeng avatar

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.