MOSliderMenu 是一个看起来与 snapseed 图像调整菜单相同的菜单。
如何使用
创建一个包含一些项的菜单
NSArray *items = @[[[MOSliderMenuItem alloc] initWithText:@"ONE"],
[[MOSliderMenuItem alloc] initWithText:@"TWO"],
[[MOSliderMenuItem alloc] initWithText:@"THREE"],
[[MOSliderMenuItem alloc] initWithText:@"FOUR"],
[[MOSliderMenuItem alloc] initWithText:@"FIVE"]];
MOSliderMenu *menu = [[MOSliderMenu alloc] initWithFrame:self.view.frame
menuItems:items
andDelegate:self];
将菜单添加到视图中
menu.autoresizingMask = UIViewAutoresizingFlexibleHeight | UIViewAutoresizingFlexibleWidth;
[self.view addSubview:menu];
然后您可以从菜单中获取事件
- (void)sliderMenu:(MOSliderMenu *)menu didSelectItemIndex:(NSInteger)index
{
//Put your code here.
}
- (void)sliderMenuChangingSelectedItemValue:(MOSliderMenu *)menu
{
//Put your code here.
}