• 一个button,一个手势+一个事件(touchupinside)


    - (void)configureArrowButton:(UIButton *)button

                        withText:(NSString *)text

                         fastTap:(SEL)fastTapSel

                         deepTap:(SEL)deepTapSel

    {

       // button.titleLabel.font = [UIFont fontWithName:@"Hiragino Mincho ProN" size:20];

        [button setTitleColor:[UIColordarkGrayColor] forState:UIControlStateNormal];

        [button setTitleColor:[UIColorblackColor] forState:UIControlStateHighlighted];

        [button setTitleShadowColor:[UIColorwhiteColor] forState:UIControlStateNormal];

        //button.titleLabel.shadowOffset = CGSizeMake(0,1);

        //[button setTitle:text forState:UIControlStateNormal];

     

       

        [button addTarget:selfaction:fastTapSel forControlEvents:UIControlEventTouchDown];

        UILongPressGestureRecognizer * deepPress = [[UILongPressGestureRecognizeralloc] initWithTarget:selfaction:deepTapSel];

        deepPress.allowableMovement = 15.0;

        deepPress.cancelsTouchesInView = NO;

        [button addGestureRecognizer:deepPress];

    }

    1,当一个按钮上同时 加事件和 手势,ios5不支持的,

  • 相关阅读:
    查看Linux内核版本的命令
    Viterbi算法
    在matlab 画箭头
    BST和DST简单的matlab程序(图的广度和深度遍历)
    灯光设置(light)
    VC++安装window8.1系统
    prim algorithm
    模拟退火
    Kruskal最小生成树
    matlab练习程序(演化策略ES)
  • 原文地址:https://www.cnblogs.com/guligei/p/3068321.html
Copyright © 2020-2023  润新知