网站/小程序/APP个性化定制开发,二开,改版等服务,加扣:8582-36016

类似Pininterest应用弹出菜单(Menu)效果

应用介绍

    类似Pininterest应用弹出菜单(Menu)效果,源码PininterestLikeMenu,实现Pininterest应用的弹出菜单的方式。长按屏幕弹出按钮,弹出的三个按钮可随着手指移动进行一些动画。另外,弹出菜单的位置会随touch位置的变动自适应。 A kind of pop-up menu How to: First, the menu can be initialized with: 源码 PininterestLikeMenuItem *item0 = [[PininterestLikeMenuItem alloc] initWithImage:[UIImage imageNamed:@"center"] selctedImage:[UIImage imageNamed:@"center-highlighted"] selectedBlock:^(void) { NSLog(@"item 0 selected"); }]; PininterestLikeMenuItem *item1 = [[PininterestLikeMenuItem alloc] initWithImage:[UIImage imageNamed:@"center"] selctedImage:[UIImage imageNamed:@"center-highlighted"] selectedBlock:^(void) { NSLog(@"item 1 selected"); }]; PininterestLikeMenuItem *item2 = [[PininterestLikeMenuItem alloc] initWithImage:[UIImage imageNamed:@"center"] selctedImage:[UIImage imageNamed:@"center-highlighted"] selectedBlock:^(void) { NSLog(@"item 2 selcted"); }]; NSArray *submenus = @[item0, item1, item2]; self.menu = [[PininterestLikeMenu alloc] initWithSubmenus:submenus]; To use this pop-up menu, you should add a long press gesture recognizer to the target view with: 源码: - (void)popPininterestMenu:(UIGestureRecognizer *)gesture { CGPoint location = [gesture locationInView:self.view.window]; if (gesture.state == UIGestureRecognizerStateBegan) { // set the start point where the menu showing up self.menu.startPoint = location; [self.menu show]; } else if (gesture.state == UIGestureRecognizerStateChanged) { [self.menu updataLocation:location]; } else { [self.menu finished]; self.menu = nil; } }

    立即下载

    请到会员中心签到后即可获得免费下载!

    评论 共有 0 条评论

    暂无评论
    0
    0
    0
    立即
    投稿
    发表
    评论
    返回
    顶部