2013-08-21 40 views
0

我有關於EKEventEditViewController不會顯示導航欄中的「添加事件」標題這個奇怪的問題。我使用下面的代碼來呈現它:EKEventEditViewController默認導航欄標題不顯示

[eventStore requestAccessToEntityType:EKEntityTypeEvent completion:^(BOOL granted, NSError *error) { 
    if (!granted) { return; } 

    __block EKEvent *calEvent = [EKEvent eventWithEventStore:eventStore]; 
    calEvent.title = self.event.title; 
    calEvent.startDate = startDate; 
    calEvent.endDate = endDate; 
    calEvent.location = self.event.address.title; 
    [calEvent setCalendar:[eventStore defaultCalendarForNewEvents]]; 

    __block EKEventEditViewController *eventViewController = [[EKEventEditViewController alloc] init]; 
    eventViewController.editViewDelegate = self; 
    eventViewController.eventStore = eventStore; 
    eventViewController.event = calEvent; 
    dispatch_async(dispatch_get_main_queue(), ^{ 
     [self presentViewController:eventViewController animated:YES completion:nil]; 
    }); 
}]; 

結果是這樣的: enter image description here

任何幫助將不勝感激。

回答

0

我不知道爲什麼這發生,但它得到了由自己,當我添加了以下的外觀在我的AppDelegate設置固定:

NSDictionary *barTitleAppearanceDict = @{UITextAttributeFont : [UIFont fontWithName:@"HelveticaNeue" size:22.0]}; 
[[UINavigationBar appearance] setTitleTextAttributes:barTitleAppearanceDict];