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

  • 相关阅读:
    TCP源码—连接建立
    TCP系列02—连接管理—1、三次握手与四次挥手
    TCP系列01—概述及协议头格式
    ubuntu软件管理apt与dpkg
    318. Maximum Product of Word Lengths
    317. Shortest Distance from All Buildings
    316. Remove Duplicate Letters
    315. Count of Smaller Numbers After Self
    314. Binary Tree Vertical Order Traversal
    313. Super Ugly Number
  • 原文地址:https://www.cnblogs.com/wanghuaijun/p/5584105.html
Copyright © 2011-2022 走看看