mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-11-05 13:26:48 +08:00
fix: setting icon color
This commit is contained in:
@@ -598,10 +598,8 @@ export class BottomNavigation extends TabNavigationBase {
|
||||
tabItemSpec.backgroundColor = backgroundColor ? backgroundColor.android : this.getTabBarBackgroundArgbColor();
|
||||
|
||||
// COLOR
|
||||
let color = this.selectedIndex === tabStripItem._index ? this._selectedItemColor : this._unSelectedItemColor;
|
||||
if (!color) {
|
||||
color = titleLabel.style.color;
|
||||
}
|
||||
let rowColor = this.selectedIndex === tabStripItem._index ? this._selectedItemColor : this._unSelectedItemColor;
|
||||
const color = rowColor || titleLabel.style.color;
|
||||
tabItemSpec.color = color && color.android;
|
||||
|
||||
// FONT
|
||||
@@ -614,7 +612,7 @@ export class BottomNavigation extends TabNavigationBase {
|
||||
// ICON
|
||||
const iconSource = tabStripItem.image && tabStripItem.image.src;
|
||||
if (iconSource) {
|
||||
const iconInfo = this.getIconInfo(tabStripItem, color);
|
||||
const iconInfo = this.getIconInfo(tabStripItem, rowColor);
|
||||
|
||||
if (iconInfo) {
|
||||
// TODO: Make this native call that accepts string so that we don't load Bitmap in JS.
|
||||
|
||||
@@ -669,11 +669,8 @@ export class Tabs extends TabsBase {
|
||||
tabItemSpec.backgroundColor = backgroundColor ? backgroundColor.android : this.getTabBarBackgroundArgbColor();
|
||||
|
||||
// COLOR
|
||||
let color = this.selectedIndex === tabStripItem._index ? this._selectedItemColor : this._unSelectedItemColor;
|
||||
if (!color) {
|
||||
color = nestedLabel.style.color;
|
||||
}
|
||||
|
||||
let rowColor = this.selectedIndex === tabStripItem._index ? this._selectedItemColor : this._unSelectedItemColor;
|
||||
const color = rowColor || nestedLabel.style.color;
|
||||
tabItemSpec.color = color && color.android;
|
||||
|
||||
// FONT
|
||||
@@ -686,7 +683,7 @@ export class Tabs extends TabsBase {
|
||||
// ICON
|
||||
const iconSource = tabStripItem.image && tabStripItem.image.src;
|
||||
if (iconSource) {
|
||||
const icon = this.getIcon(tabStripItem, color);
|
||||
const icon = this.getIcon(tabStripItem, rowColor);
|
||||
|
||||
if (icon) {
|
||||
// TODO: Make this native call that accepts string so that we don't load Bitmap in JS.
|
||||
|
||||
Reference in New Issue
Block a user