zoukankan      html  css  js  c++  java
  • 一个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不支持的,

  • 相关阅读:
    HTML5
    HTML5
    HTML5
    HTML5
    HTML5
    HTML5
    HTML5
    HTML5
    HTML5
    53.Maximum Subarray
  • 原文地址:https://www.cnblogs.com/guligei/p/3068321.html
Copyright © 2011-2022 走看看