我正在开发一个 iPhone 应用程序,它充当开关灯泡的遥控器,我正在使用 UIButtons 来执行此操作:
UIButton *button = [UIButton buttonWithType:UIButtonTypeRoundedRect];
[button addTarget:self action:@selector(buttonPressed:) forControlEvents:UIControlEventTouchDown];
[button setBackgroundImage:bulb_on forState:UIControlStateSelected];
[button setBackgroundImage:bulb_off forState:UIControlStateNormal];
button.frame = CGRectMake(SPACING_LEFT + (BUTTON_SPACING * buttonNum) % (NUMBER_OF_HORIZONTAL_BUTTONS * BUTTON_SPACING), SPACING_TOP + y_padding, BUTTON_SIZE_X, BUTTON_SIZE_Y);
[self.scrollView addSubview:button];
一切正常,除了一点点,但仍然令人讨厌的细节:
如您所见,所选按钮的左上角有某种蓝色“框”或阴影。正常状态下的按钮没有这个东西。这可能来自什么,以及如何删除它?