(item: TabViewItem)
| 621 | } |
| 622 | |
| 623 | public _getIcon(item: TabViewItem): UIImage { |
| 624 | if (!item || !item.iconSource) { |
| 625 | return null; |
| 626 | } |
| 627 | |
| 628 | let image: UIImage = this._iconsCache[item.iconSource]; |
| 629 | if (!image) { |
| 630 | let is: ImageSource; |
| 631 | if (isSystemURI(item.iconSource)) { |
| 632 | is = ImageSource.fromSystemImageSync(item.iconSource.slice(SYSTEM_PREFIX.length)); |
| 633 | } else if (isFontIconURI(item.iconSource)) { |
| 634 | // Allow specifying a separate font family for the icon via style.iconFontFamily. |
| 635 | // If provided, construct a Font from the family and (optionally) size from fontInternal. |
| 636 | let iconFont = item.style.fontInternal; |
| 637 | const iconFontFamily = item.iconFontFamily || item.style.iconFontFamily; |
| 638 | if (iconFontFamily) { |
| 639 | // Preserve size/style from existing fontInternal if present. |
| 640 | const baseFont = item.style.fontInternal || Font.default; |
| 641 | iconFont = baseFont.withFontFamily(iconFontFamily); |
| 642 | } |
| 643 | is = ImageSource.fromFontIconCodeSync(item.iconSource.slice(FONT_PREFIX.length), iconFont, item.style.color); |
| 644 | } else { |
| 645 | is = ImageSource.fromFileOrResourceSync(item.iconSource); |
| 646 | } |
| 647 | if (is && is.ios) { |
| 648 | const originalRenderedImage = is.ios.imageWithRenderingMode(this._getIconRenderingMode()); |
| 649 | this._iconsCache[item.iconSource] = originalRenderedImage; |
| 650 | image = originalRenderedImage; |
| 651 | } else { |
| 652 | traceMissingIcon(item.iconSource); |
| 653 | } |
| 654 | } |
| 655 | |
| 656 | return image; |
| 657 | } |
| 658 | |
| 659 | private _updateIOSTabBarColorsAndFonts(): void { |
| 660 | if (!this.items) { |
no test coverage detected