내 iOS 앱에서 버튼이 : 10 분비활성화 버튼
_Button = [UIButton buttonWithType:UIButtonTypeCustom];
UIImage *shareIMG = [UIImage imageNamed:@"button.png"];
[_Button setBackgroundImage:shareIMG forState:UIControlStateNormal];
[_Button setBackgroundImage:[UIImage imageNamed:@"button_active.png"] forState:UIControlStateHighlighted];
[_Button addSubview:titleLabel];
UILabel * titleLabel = [[UILabel alloc] initWithFrame:CGRectMake(0, 3, shareIMG.size.width, shareIMG.size.height)];
[titleLabel setTextAlignment:UITextAlignmentCenter];
[titleLabel setText:@"Button";
[_Button addSubview:titleLabel];
[titleLabel release];
[_Button setFrame:CGRectMake(2 * self.sendPushButton.frame.origin.x + self.sendPushButton.frame.size.width , 380 - liteIndent1 - liteIndent2 + iphone5Fix, shareIMG.size.width, shareIMG.size.height)];
[self addSubview:_Button];
가이 버튼을 비활성화 (button_non_active.png)을 만드는 방법을 도와 수 및 취소 클릭 클릭 후? .
-(void)enableButton:(UIButton *)button {
[button setBackgroundImage:[UIImage imageNamed:@"button_active.png"] forState:UIControlStateHighlighted];
button.enabled = YES;
}
그리고 누르면 발사됩니다 셀렉터 (당신이 당신의 조각에서이 누락 된 것으로 보인다으로 설정 :
이 응용 프로그램은 사망하고 다시 시작하더라도? –
버튼을 클릭 할 때 NSTimer를 사용하거나 비활성화하거나 userInteraction을 false로 설정하고 타이머를 10 분으로 설정하고 NSTimer 함수에서 버튼을 활성화하거나 userInteraction을 TRUE로 설정합니다. –