2009-07-31 23 views
0

모든 기능이 제대로 작동하는 전자 메일 기능보기를 만들었지 만 탐색 모음 항목의 색상이 다른보기처럼 변경되지 않았습니다. 내비게이션 색상 아래에 코드를 사용했지만 탐색 막대 항목 1 개가 기본 색상으로 남아 있습니다. 어떻게 변경합니까?내비게이션 막대 (iPhone)

controller.navigationBar.barStyle = UIBarStyleBlack;

답변

0

직접 바 버튼 항목을 만드십니까?

// Assuming you have some predetermined width w and height h 
UIView *backgroundView = [[[UIView alloc] 
          initWithFrame:CGRectMake(0.0, 0.0, w, h)] autorelease]; 
backgroundView.backgroundColor = [UIColor blackColor]; 
UIBarButtonItem *myItem = [[[UIBarButtonItem alloc] 
          initWithCustomView:backgroundView] autorelease];

그런 다음 당신은 바 버튼 항목의에 backgroundColor 속성을 설정하여 미래의 날짜에 배경 색상을 변경할 수 있습니다 : 그렇다면, 당신은 그것이 "사용자 정의보기"유형 버튼 항목의 확인하여 자사의 배경 색상을 변경할 수 있습니다 customView :

myItem.customView.backgroundColor = [UIColor yellowColor];
+0

{ \t MFMailComposeViewController 컨트롤러 * = [MFMailComposeViewController의 ALLOC] INIT]의 과정

self.navigationController.navigationBar.tintColor = [UIColor blackColor]; 

; \t controller.mailComposeDelegate = self; \t NSMutableArray * messgeToField = [[NSMutableArray alloc] init]; \t NSString * str = @ "[email protected]"; \t [messgeToField addObject : str]; \t [컨트롤러 setToRecipients : messgeToField]; \t [컨트롤러 setSubject : @ "피드백"]; \t [컨트롤러 setMessageBody : @ ""isHTML : NO]; \t controller.navigationBar.barStyle = UIBarStyleBlack; \t [self presentModalViewController : 컨트롤러 애니메이션 : 예]; \t [컨트롤러 릴리스]; \t [messgeToField release]; } –

+0

이메일 기능을 위해이 코드를 사용했습니다. 나는 네비게이션 바 또는 바 버튼이 아닌 펜촉 2를 만들지 않습니다. 2 개의 바 버튼 항목이 있습니다. controller.navigationBar.barStyle = UIBarStyleBlack; 이 코드는 1 막대 버튼 항목의 색상 만 변경합니다. 어떤 솔루션이라도 알려주세요 4 ds –

+0

안녕하세요, 코드를 사용해 보았지만 너무 효과가 없습니다 –

1

사용 방법은? 당신의 viewDidLoad

관련 문제