2012-05-11 7 views
0

액세서리보기를 사용하여 UIKeyboardTypeNumPad에 빼기 단추를 추가하려고합니다. 내 문제는 그것이 키보드 (왼쪽 "0"키)에 있어야한다는 것입니다.uikeyboardtypenumpad에 빼기 단추 추가

- (UIView *)inputAccessoryView { 
if (!inputAccessoryView) { 
     CGRect accessFrame = CGRectMake(0, 219, 106, 53); 
     inputAccessoryView = [[UIView alloc] initWithFrame:accessFrame]; 
     inputAccessoryView.backgroundColor = [UIColor blueColor]; 
     UIButton *compButton = [UIButton buttonWithType:UIButtonTypeCustom]; 
     compButton.frame = CGRectMake(0, 219, 106, 53); 
     [compButton setTitle: @"Word" forState:UIControlStateNormal]; 
     [compButton setTitleColor:[UIColor blackColor] forState:UIControlStateNormal]; 
     [compButton addTarget:self action:@selector(minusButtonTouched:) 
     forControlEvents:UIControlEventTouchUpInside]; 
     [inputAccessoryView addSubview:compButton]; 
    } 
return inputAccessoryView; 
} 

키보드 해킹을 사용하여 수행 할 수 있지만 사과가 내 앱을 거부 할 수 있습니다.

답변

0

이 유형의 키보드 해킹으로 인해 Apple에서 앱을 거부 할 수 있습니다. 여분의 키가 필요하면 시스템 키보드에 버튼을 추가하는 대신 키보드 전체를 디자인하는 것이 좋습니다. 그렇게하면 구현하기가 훨씬 쉬울 것입니다.

예를 들어 사용자가 숫자 값과 + 또는 -와 같은 특수 문자를 입력하게하려면 숫자와 이러한 특수 문자로만 새 키보드를 디자인 할 수 있습니다.

출처 : 앱 스토어의 다양한 앱 (광산 포함).

+0

그러나 사과는 위의 코드로 내 앱을 거부하지 않았습니다 ... –

+0

...하지만 리뷰하는 사람에 따라 다릅니다. –