Reviewed By: @nicklockwood

Differential Revision: D2508310

fb-gh-sync-id: e4eaf1237cca380b74d154c3cda50379fbafcf00
This commit is contained in:
Pieter De Baets 2015-10-06 07:42:59 -07:00 коммит произвёл facebook-github-bot-4
Родитель 81278d1a39
Коммит 06ef95799a
1 изменённых файлов: 5 добавлений и 5 удалений

Просмотреть файл

@ -54,8 +54,8 @@
UIImage *image = [RCTConvert UIImage:_icon];
UITabBarItem *oldItem = _barItem;
if (image) {
// Recreate barItem if previous item was a system icon
// Recreate barItem if previous item was a system icon. Calling self.barItem
// creates a new instance if it wasn't set yet.
if (wasSystemIcon) {
_barItem = nil;
self.barItem.image = image;
@ -63,9 +63,7 @@
self.barItem.image = image;
return;
}
} else {
} else if ([icon isKindOfClass:[NSString class]] && [icon length] > 0) {
// Not a custom image, may be a system item?
NSNumber *systemIcon = systemIcons[icon];
if (!systemIcon) {
@ -73,6 +71,8 @@
return;
}
_barItem = [[UITabBarItem alloc] initWithTabBarSystemItem:systemIcon.integerValue tag:oldItem.tag];
} else {
self.barItem.image = nil;
}
// Reapply previous properties