RNGridMenu -好用的弹出框的第三方库

第三库下载地址:http://code4app.com/ios/Popup-Grid-Menu/51e3874c6803fac50d000001

RNGridMenu的demo讲解很详细,自己敲一遍也能能够马上会用。

共有两个类:RNGridMenu和RNGridMenuItem。前面这个类用来初始化显示在视图控制器上的对象,后面的类是一个视图控制器。

用法:

(1)创建一个数组

弹出的列表;弹出的图片和按钮介绍,图片和按钮介绍可以二选其一。如果弹出列表,数组中放字符串对象。如果弹出的图片,数组中存储RNGridMenuItem

对象。

(2)初始化RNGridMenuItem 

// Initialize the menu with a list of menu items.

// Note: this changes the view to style RNGridMenuStyleList if no images are supplied

- (instancetype)initWithItems:(NSArray *)items;

// Initialize the menu with a list of images. Maintains style RNGridMenuStyleGrid

- (instancetype)initWithImages:(NSArray *)images;

// Initialize the menu with a list of titles. Note: this changes the view to style RNGridMenuStyleList since no images are supplied

- (instancetype)initWithTitles:(NSArray *)titles;

(3)

// Show the menu

- (void)showInViewController:(UIViewController *)parentViewController center:(CGPoint)center;

如何知道用户点击了哪一个图片?

用到它的代理方法。说到这里有没有这里有没有觉得这个特别和UIAlertView相似的用法

@protocol RNGridMenuDelegate <NSObject>

@optional

- (void)gridMenu:(RNGridMenu *)gridMenu willDismissWithSelectedItem:(RNGridMenuItem *)item atIndex:(NSInteger)itemIndex;

- (void)gridMenuWillDismiss:(RNGridMenu *)gridMenu;

@end




  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值