2011-06-14 6 views

답변

3
[aButton setTitleColor:[UIColor grayColor] forState: UIControlStateNormal] 

다음 다른 버튼이 위와 같은 코드를 사용하여 만 다른 색으로 클릭하면 색상을 변경할 수 있습니다.

+0

좋아,하지만 : 그래서

NSInteger tag = 1; UIView *aView; while ((aView = [contentView viewWithTag:tag])) { if([aView isKindOfClass:[UITextField class]]){ [(UITextView *)aView setReturnKeyType:UIReturnKeySend]; } tag++; } 

난 당신이 이런 일을 할 수 같은데요 : 내 키보드가 내 UITextFiles 각 키 형태를 돌려 설정하는 코드의이 비트를 사용 매번 20 개의 버튼을 눌러야합니까? 나는 자동으로 상태를 처리하는 것이 좋을 것이라고 생각한다. – Cris

0

버튼을 순환하는 한 가지 방법은 순환하려는 버튼에 태그를 설정하는 것입니다. 내가있는 경우

NSInteger tag = 1; 
UIView *aView; 
while ((aView = [contentView viewWithTag:tag])) { 
    if([aView isKindOfClass:[UIButton class]]){ 
     [ aView setTitleColor:[UIColor grayColor] forState: UIControlStateNormal]; 
    } 
    tag++; 
} 
관련 문제