Tag: touch up inside

在选定的UIButton上单击时突出显示的UIButton状态

当我点击已经select的button时,我想让我的UIButton显示突出显示的状态。 基本上在突出显示的状态,我应用一个* .png图像作为我的UIButton backgroundImage给予按下的效果。 但是,如果button已经在选定的状态当我再次点击它,我只是看不到突出显示的状态,但它直接进入正常状态! 观看问题 – >问题的 video! 请帮助 //0 init UIButton UIButton *button = [[UIButton alloc] initWithFrame:CGRectMake(x, y, aSide, aSide)]; //1 Give it a backgroundColor [button setBackgroundColor:aColor]; [..] //2 Set titleLabel and its style [button setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal]; [button setTitleColor:[UIColor redColor] forState:UIControlStateSelected]; [button setTitleColor:[UIColor grayColor] forState:UIControlStateHighlighted]; UIImage *shadowImage = [UIImage imageNamed:kBtnShadow]; shadowImage = […]