font-family implemented

This commit is contained in:
Vladimir Enchev
2015-12-10 12:03:18 +02:00
parent 06c164c747
commit 3650a6f4fe
7 changed files with 133 additions and 9 deletions

View File

@@ -101,7 +101,7 @@ export class TabViewItem extends common.TabViewItem {
function selectedColorPropertyChanged(data: dependencyObservable.PropertyChangeData) {
var tabView = <TabView>data.object;
tabView._updateIOSTabBarColors();
tabView._updateIOSTabBarColorsAndFonts();
}
(<proxy.PropertyMetadata>common.TabView.selectedColorProperty.metadata).onSetNativeValue = selectedColorPropertyChanged;
@@ -322,14 +322,14 @@ export class TabView extends common.TabView {
(heightMode === utils.layout.UNSPECIFIED) ? Number.POSITIVE_INFINITY : height));
}
public _updateIOSTabBarColors(): void {
public _updateIOSTabBarColorsAndFonts(): void {
if (!this.items) {
return;
}
var tabBar = this.ios.tabBar;
tabBar.tintColor = this.selectedColor ? this.selectedColor.ios : null;
tabBar.tintColor = this.selectedColor ? this.selectedColor.ios : null;
var states = getTitleAttributesForStates(this);
for (var i = 0; i < this.items.length; i++) {
@@ -354,8 +354,13 @@ function getTitleAttributesForStates(tabView: TabView): { normalState: any, sele
selectedState[UITextAttributeTextColor] = tabView.ios.tabBar.tintColor;
}
var defaultFont = UIFont.systemFontOfSize(UIFont.labelFontSize());
var font = (<any>tabView.style)._fontInternal.getUIFont(defaultFont);
normalState[NSFontAttributeName] = font;
selectedState[NSFontAttributeName] = font;
return {
normalState: normalState,
selectedState: selectedState
};
}
}