3 개의 버튼 중 하나를 클릭 한 것과 관련하여 Look of 3 버튼 (TitleLable + Background) 및 TextView의 텍스트를 변경하려고합니다. (탭의 내용처럼 뭔가)클릭 후 UIButton의 텍스트 또는 배경 변경
내가 XIB의 4 개 요소를 만들었습니다 '하고 .H로를 연결 : 여기에 (4 개 요소를 변경하는 코드를 시도 .mi 상기
IBOutlet UIButton *buttonTab1;
IBOutlet UIButton *buttonTab2;
IBOutlet UIButton *buttonTab3;
IBOutlet UITextView *thisDescription;
- (IBAction)showTab1:(id)sender;
- (IBAction)showTab2:(id)sender;
- (IBAction)showTab3:(id)sender;
@property (strong, nonatomic) IBOutlet UIButton *buttonTab1;
@property (strong, nonatomic) IBOutlet UIButton *buttonTab2;
@property (strong, nonatomic) IBOutlet UIButton *buttonTab3;
버튼 1)에 대한 :
@synthesize buttonTab1, buttonTab2, buttonTab3;
- (IBAction)showTab1:(id)sender{
thisDescription.text = [NSString stringWithFormat:@"INHALT TAB 1: %@",transferDescription];
buttonTab1.imageView.image = [UIImage imageNamed:@"content_tab1_on.png"];
buttonTab2.imageView.image = [UIImage imageNamed:@"content_tab2.png"];
buttonTab3.imageView.image = [UIImage imageNamed:@"content_tab3.png"];
buttonTab1.titleLabel.text = @"Tab1on";
buttonTab2.titleLabel.text = @"Tab2";
buttonTab3.titleLabel.text = @"Tab3";
}
TextViewElement의 텍스트가 잘 변경하지만 제목 & 배경은 XIB처럼 동일합니다.
감사합니다. 정상적으로 작동합니다. –