@@ -6,7 +6,7 @@ import { TabStrip } from '@nativescript-community/ui-material-core-tabs/tab-stri
6
6
import { TabStripItem } from '@nativescript-community/ui-material-core-tabs/tab-strip-item' ;
7
7
// Types
8
8
// Requires
9
- import { CSSType , Color , CoreTypes , Device , Font , Frame , IOSHelper , ImageSource , Property , Utils , View , booleanConverter } from '@nativescript/core' ;
9
+ import { CSSType , Color , CoreTypes , Device , Font , Frame , IOSHelper , ImageSource , ImageAsset , Property , Utils , View , booleanConverter } from '@nativescript/core' ;
10
10
import { getTransformedText } from '@nativescript/core/ui/text-base' ;
11
11
import { iOSNativeHelper } from '@nativescript/core/utils' ;
12
12
export { TabContentItem , TabStrip , TabStripItem } ;
@@ -690,19 +690,28 @@ export class BottomNavigation extends TabNavigationBase {
690
690
}
691
691
const iconTag = [ iconSource , font . fontStyle , font . fontWeight , font . fontSize , font . fontFamily , color ] . join ( ';' ) ;
692
692
693
- let isFontIcon = false ;
693
+ const isFontIcon = false ;
694
694
let image : UIImage = this . mIconsCache [ iconTag ] ;
695
695
if ( ! image ) {
696
- let is ;
697
- if ( Utils . isFontIconURI ( iconSource ) ) {
698
- isFontIcon = true ;
699
- const fontIconCode = iconSource . split ( '//' ) [ 1 ] ;
700
- is = ImageSource . fromFontIconCodeSync ( fontIconCode , font , color ) ;
696
+ let is : ImageSource | ImageAsset ;
697
+ if ( typeof iconSource === 'string' ) {
698
+ if ( Utils . isFontIconURI ( iconSource ) ) {
699
+ const fontIconCode = iconSource . split ( '//' ) [ 1 ] ;
700
+ const target = tabStripItem . image ? tabStripItem . image : tabStripItem ;
701
+ const font = target . style . fontInternal ;
702
+ if ( ! color ) {
703
+ color = target . style . color ;
704
+ }
705
+ is = ImageSource . fromFontIconCodeSync ( fontIconCode , font , color ) ;
706
+ } else {
707
+ is = ImageSource . fromFileOrResourceSync ( iconSource ) ;
708
+ }
701
709
} else {
702
- is = ImageSource . fromFileOrResourceSync ( iconSource ) ;
710
+ is = iconSource ;
703
711
}
704
712
705
- if ( is && is . ios ) {
713
+ image = is ?. ios ;
714
+ if ( image ) {
706
715
image = is . ios ;
707
716
708
717
if ( this . tabStrip && this . tabStrip . isIconSizeFixed ) {
0 commit comments