0
我正在使用MWPhotoBrowser在導航中顯示圖像。對於多個圖像,它工作正常。但是當顯示一個圖像(圖像數量是1)時,它不會顯示圖像名稱作爲導航欄的標題。我如何解決這個問題?這裏是委託方法的代碼:MWPhotoBrowser不顯示導航標題中單個圖像的顯示圖像名稱
- (void) photoBrowser:(MWPhotoBrowser *)photoBrowser didDisplayPhotoAtIndex:(NSUInteger)index {
NSLog(@"Photo displayed");
if (index < [self.imagesGallery count]) {
NSString *imageName = [self.imagesGallery objectAtIndex:index];
photoBrowser._titleText = [imageName stringByDeletingPathExtension];
NSLog(@"Title: %@", photoBrowser._titleText);
NSString *element = [[[imageName stringByDeletingPathExtension] componentsSeparatedByString:@"-"] objectAtIndex:1];
int index_ = [deficiencesShort indexOfObject:element];
photoBrowser._actionButton.title = [NSString stringWithFormat:@"Go To %@ Deficiency", [deficiences objectAtIndex:index_]];
}
}
對於單個圖像,的NSLog(@「名稱:%@」,photoBrowser._titleText)顯示圖像的名稱作爲輸出,但不設定爲導航欄標題
是的,我做到了,它工作 –