在下面网站可以找到demo:
http://123.th7.cn/code/MLKMenuPopover_2415.html
主要内容:
增加 MLKMenuPopover 这样一个类。
这个类用来显示悬浮窗。
增加一个 协议。
协议里面有一下方法:
- (void)menuPopover:(MLKMenuPopover *)menuPopover didSelectMenuItemAtIndex:(NSInteger)selectedIndex;
用来提供 按下按键的操作。
这个类 提供四个方法
- (id)initWithFrame:(CGRect)frame menuItems:(NSArray *)menuItems; 创建悬浮窗
- (void)showInView:(UIView *)view; 显示悬浮窗
- (void)dismissMenuPopover; 隐藏悬浮窗
- (void)layoutUIForInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation;
@property(nonatomic,retain) NSArray *menuItems; 悬浮窗口的内容数组
//创建悬浮窗口 aMenuItems 这个参数是内容 frame是大小
- (id)initWithFrame:(CGRect)frame menuItems:(NSArray *)aMenuItems
{
self = [super initWithFrame:frame];
if (self)
{
self.menuItems = aMenuItems;