您的位置:首页 > 产品设计 > UI/UE

给button增加点击事件时这个地方也加上了 UIControlEventTouchUpOutside 这个

2013-09-17 10:56 696 查看
self.typeButton = [UIButtonbuttonWithType:UIButtonTypeCustom];
        self.typeButton.frame =self.bounds;
        self.typeButton.showsTouchWhenHighlighted =YES;
        self.typeButton.titleLabel.textAlignment =GNTextAlignmentCenter;
        UIColor* color = [UIColorcolorWithRed:136.f/255.fgreen:90.f/255.fblue:31.f/255.falpha:1.0f];
        [self.typeButtonsetTitleColor:color
forState:UIControlStateNormal];
        self.typeButton.titleLabel.font = [UIFontsystemFontOfSize:10.0f];
        self.typeButton.titleLabel.textAlignment =GNTextAlignmentCenter;
        [self.typeButtonsetTitleEdgeInsets:UIEdgeInsetsMake(25.0f,
-19.0f,10.0f,0.0f)];
        [self.typeButtonsetImageEdgeInsets:UIEdgeInsetsMake(4.0f,12.0f,
20.0f,12.0f)];
        [self.typeButtonaddTarget:self
action:@selector(handleLandTipSelected:)
                  forControlEvents:UIControlEventTouchUpInside|UIControlEventTouchUpOutside];
        [self addSubview:self.typeButton];

PS:查了下资料,UIControlEventTouchUpOutside 这个貌似是点击button后不放开,然后拖动到外面,接着才放开的事件
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐