iOS 6에서 볼 수있는 도구 모음에서 Barbutton 항목의 제목이지만 iOS 7

StackOverflow https://stackoverflow.com//questions/24002255

  •  20-12-2019
  •  | 
  •  

문제

도구 모음에 대한 아래 코드를 사용하고 있으며 iOS 6의 제목을 보여 주지만 Fro iOS 7이 아닙니다.

UIBarButtonItem *settingButton = [[UIBarButtonItem alloc] initWithImage:[UIImage imageNamed:@"multimedia/icon_settings.png"] style:UIBarButtonItemStylePlain                                                                  target:self                                                                 action:@selector(pressSettings:)];
UIBarButtonItem *refreshButton = [[UIBarButtonItem alloc] initWithImage:[UIImage imageNamed:@"multimedia/icon_refresh.png"]                                                                style:UIBarButtonItemStylePlain target:self                                                                 action:@selector(pressRefresh:)];
UIBarButtonItem *helpButton = [[UIBarButtonItem alloc] initWithImage:[UIImage imageNamed:@"multimedia/icon_help.png"]                                                                  style:UIBarButtonItemStylePlain target:self action:@selector(pressHelp:)];
UIBarButtonItem *flexSpace = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemFlexibleSpace target:nil action:nil];

/* Set the title of the button */
[settingButton setTitle:@"Settings"];
[refreshButton setTitle:@"Refresh"];
[helpButton setTitle:@"Help"];
[feedbackButton setTitle:@"Feedback"];

NSArray *toolbarButtons = @[settingButton, flexSpace, helpButton, flexSpace, feedbackButton, flexSpace, refreshButton];

[self setToolbarItems:toolbarButtons];
.

이 코드는 iOS 6에서 잘 작동하지만 iOS 7의 바 단추 이미지 만 제목이 아닙니다.

도움이 되었습니까?

해결책

UINAvigationController는 스택의 각 뷰 컨트롤러에 대해 UIToolbar를 유지 관리합니다.이 도구 모음은 일반적으로 숨겨져 있습니다.따라서 도구 모음을 명시 적으로 표시해야합니다.

[self.navController setToolbarHidden:NO];
.

ViewController의 네비게이션 컨트롤러를 가져 와서 위의 SetToolbarhidden 속성을 No로 설정합니다.

당신이 도움이되기를 바랍니다.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top