mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-08-17 04:41:36 +08:00
Fixes
This commit is contained in:
@ -662,11 +662,13 @@ export class TabViewStyler implements definition.stylers.Styler {
|
||||
}
|
||||
|
||||
var tab = <tabView.TabView>view;
|
||||
var count = tab.items ? tab.items.length : 0;
|
||||
var tabLayout = tab._getAndroidTabView();
|
||||
|
||||
for (var i = 0; i < count; i++) {
|
||||
tabLayout.getTextViewForItemAt(i).setTextColor(nativeValue);
|
||||
if (tab.items && tab.items.length > 0) {
|
||||
var tabLayout = tab._getAndroidTabView();
|
||||
|
||||
for (var i = 0; i < tab.items.length; i++) {
|
||||
tabLayout.getTextViewForItemAt(i).setTextColor(nativeValue);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -257,7 +257,7 @@ export class TabView extends view.View implements definition.TabView, view.AddAr
|
||||
return undefined;
|
||||
}
|
||||
|
||||
public _updateIOSTabBarColors() {
|
||||
public _updateIOSTabBarColors(): void {
|
||||
// iOS sepcific
|
||||
}
|
||||
}
|
2
ui/tab-view/tab-view.d.ts
vendored
2
ui/tab-view/tab-view.d.ts
vendored
@ -96,7 +96,7 @@ declare module "ui/tab-view" {
|
||||
|
||||
//@private
|
||||
_getAndroidTabView(): org.nativescript.widgets.TabLayout;
|
||||
_updateIOSTabBarColors();
|
||||
_updateIOSTabBarColors(): void;
|
||||
//@endprivate
|
||||
}
|
||||
}
|
@ -78,7 +78,7 @@ class UINavigationControllerDelegateImpl extends NSObject implements UINavigatio
|
||||
export class TabViewItem extends common.TabViewItem {
|
||||
public _controller: UIViewController;
|
||||
public _parent: TabView;
|
||||
|
||||
|
||||
public _update() {
|
||||
if (this._parent && this._controller) {
|
||||
var icon = this._parent._getIcon(this.iconSource);
|
||||
@ -198,7 +198,7 @@ export class TabView extends common.TabView {
|
||||
item._controller = newController;
|
||||
|
||||
var icon = this._getIcon(item.iconSource);
|
||||
|
||||
|
||||
var tabBarItem = UITabBarItem.alloc().initWithTitleImageTag((item.title || ""), icon, i);
|
||||
if (!icon) {
|
||||
if (types.isFunction(tabBarItem.setTitlePositionAdjustment)) {
|
||||
@ -308,7 +308,7 @@ export class TabView extends common.TabView {
|
||||
(heightMode === utils.layout.UNSPECIFIED) ? Number.POSITIVE_INFINITY : height));
|
||||
}
|
||||
|
||||
public _updateIOSTabBarColors() {
|
||||
public _updateIOSTabBarColors(): void {
|
||||
if (!this.items) {
|
||||
return;
|
||||
}
|
||||
@ -325,12 +325,12 @@ export class TabView extends common.TabView {
|
||||
}
|
||||
|
||||
function getTitleAttributesForStates(tabView: TabView): { normalState: any, selectedState: any } {
|
||||
var normalState = <any>{};
|
||||
var normalState = {};
|
||||
if (tabView.color instanceof color.Color) {
|
||||
normalState[UITextAttributeTextColor] = tabView.color.ios;
|
||||
}
|
||||
|
||||
var selectedState = <any>{};
|
||||
var selectedState = {};
|
||||
if (tabView.selectedColor instanceof color.Color) {
|
||||
selectedState[UITextAttributeTextColor] = tabView.selectedColor.ios;
|
||||
}
|
||||
|
Reference in New Issue
Block a user