use*_*145 2 iphone objective-c uibutton ios7
我有一个大的UIButton,我已经分类并在点击期间设置背景颜色.
    [self addTarget:self action:@selector(pressed) forControlEvents:UIControlEventTouchDown];
    [self addTarget:self action:@selector(releasedInside) forControlEvents:UIControlEventTouchUpInside];
    [self addTarget:self action:@selector(releasedOutside) forControlEvents:UIControlEventTouchUpOutside];
但是,当我按下按钮上的文字区域时,它似乎只会响应.当我点击彩色背景时,我也想要它回应.这该怎么做?
按钮没有响应它内部的点击(我有一个边框,所以我知道它的界限)因为我在点击之前将背景设置为透明.
我设法做了一个解决方法:
[self setBackgroundColor:[UIColor colorWithRed:0 green:0 blue:0 alpha:0.01]];
很奇怪为什么会这样......
| 归档时间: | 
 | 
| 查看次数: | 1497 次 | 
| 最近记录: |