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)显示图像的名称作为输出,但不设定为导航栏标题
是的,我做到了,它工作 –