zoukankan      html  css  js  c++  java
  • Ios 弹框 MJPopup,KxMenu

    IOS 弹框 如果直接弹出一个自定义的视图 可以选用第三方:

    MJPopup

    弹出:

    if(!bandview)

        {

            bandview=[[[NSBundle mainBundle]loadNibNamed:@"bandView" owner:selfoptions:nil] firstObject];

            bandview.bdelagate=self;

            [bandview setFrame:CGRectMake(0, 0, 320, 160)];

        }

        int offset=ISIPhone5?100:50;

        [self presentPopupView:bandview animationType:MJPopupViewAnimationFadeoffset:offset];

    收起

    [self dismissPopupViewControllerWithanimationType:MJPopupViewAnimationFade];

    一般的菜单弹出可用

    KxMenu

     NSArray *menuItems =

        @[

          [KxMenuItem menuItem:@"明细统计方式"

                         image:nil

                        target:nil

                        action:NULL],

          

          [KxMenuItem menuItem:@"现金"

                         image:[UIImageimageNamed:@"action_icon"]

                        target:self

                       action:@selector(pushMenuItem:)],

          

          [KxMenuItem menuItem:@"余额"

                         image:[UIImageimageNamed:@"check_icon"]

                        target:self

                       action:@selector(pushMenuItem:)],

          

          [KxMenuItem menuItem:@"POS"

                         image:[UIImageimageNamed:@"reload"]

                        target:self

                       action:@selector(pushMenuItem:)]

          ];

        

        KxMenuItem *first = menuItems[0];

        first.foreColor = [UIColorcolorWithRed:47/255.0f green:112/255.0f blue:225/255.0f alpha:1.0];

        first.alignment = NSTextAlignmentCenter;

        

        CGRect rect=button.frame;

        CGFloat height=0.0;

        if(IOS7>=7.0)

        {

            height=64;

        }

        else

        {

            height=0.0;

        }

        [KxMenu showMenuInView:self.view

                     fromRect:CGRectMake(rect.origin.x, rect.origin.y, rect.size.width, height)

                     menuItems:menuItems];

    点击事件实现:

    - (void) pushMenuItem:(KxMenuItem*)sender

  • 相关阅读:
    965. 单值二叉树
    面试题 04.09. 二叉搜索树序列
    99. 恢复二叉搜索树
    98. 验证二叉搜索树
    centos6版本下的Python2.6升级到2.7
    操作MySQL-数据库的安装及Pycharm模块的导入
    操作微信-itchat库的安装
    2018中科大hackergame
    png图片IDAT块异常
    2018网鼎杯misc
  • 原文地址:https://www.cnblogs.com/wanghuaijun/p/5584105.html
Copyright © 2011-2022 走看看