Skip to content

Commit 75769f4

Browse files
authored
Merge pull request #239 from NativeScript/tsonevn_tab_view_icon_font
tab view icon font
2 parents c3de455 + f6a3766 commit 75769f4

7 files changed

+959
-14
lines changed

Diff for: app/ui-category/tab-view/tab-view-examples.component.ts

+1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ let menuLinks = [
66
new Link("TabView items", "/tab-view/items"),
77
new Link("Customizing Tab View", "/tab-view/customizing"),
88
new Link("Binding (Two-way) TabView selectedIndex", "/tab-view/binding"),
9+
new Link("Using icon font in TabView", "/tab-view/icon-fonts"),
910
];
1011

1112
@Component({

Diff for: app/ui-category/tab-view/tab-view-examples.module.ts

+8-1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import { NativeScriptRouterModule } from "nativescript-angular/router";
33
import { NativeScriptCommonModule } from "nativescript-angular/common";
44
import { TabViewExamplesComponent } from "./tab-view-examples.component";
55
import { BasicTabViewComponent } from "./basic-tab-view/basic-tab-view.component";
6+
import { TabViewIconFontsComponent } from "./tab-view-icon-fonts/tab-view-icon-fonts.component";
67
import { TabViewItemsComponent } from "./tab-view-items/tab-view-items.component";
78
import { CustomizingTabViewItemsComponent } from "./customizing-tab-view-items/customizing-tab-view-items.component";
89
import { BindingTabViewItemsComponent } from "./binding-tab-view-items/binding-tab-view-items.component";
@@ -32,6 +33,11 @@ export const routerConfig = [
3233
path: "binding",
3334
component: BindingTabViewItemsComponent,
3435
data: { title: "Binding (Two-way) TabView selectedIndex" }
36+
},
37+
{
38+
path: "icon-fonts",
39+
component: TabViewIconFontsComponent,
40+
data: { title: "Using icon font in TabView" }
3541
}
3642
];
3743

@@ -49,7 +55,8 @@ export const routerConfig = [
4955
BasicTabViewComponent,
5056
TabViewItemsComponent,
5157
CustomizingTabViewItemsComponent,
52-
BindingTabViewItemsComponent
58+
BindingTabViewItemsComponent,
59+
TabViewIconFontsComponent
5360
]
5461
})
5562

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
HTML
2+
<snippet id='tabview-icon-font-html'/>
+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
.icon{
2+
font-family: 'icomoon';
3+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<!-- >> tabview-icon-font-html -->
2+
<TabView class="icon" selectedIndex="0" sdkExampleTitle sdkToggleNavButton>
3+
<StackLayout *tabItem="{title: '&#xe913;'}">
4+
<Label text="First TabView item with Icon Font" textAlignment="center" textWrap="true" class="h2 m-x-auto" color="blue"></Label>
5+
<Label text="&#xe913;" textWrap="true" class="h2 m-x-auto" color="blue"></Label>
6+
</StackLayout>
7+
<StackLayout *tabItem="{title: '&#xe908;'}">
8+
<Label text="Second TabView item with Icon Font" textAlignment="center" textWrap="true" class="h2 m-x-auto" color="green"></Label>
9+
<Label text="&#xe908;" textWrap="true" class="h2 m-x-auto" color="green"></Label>
10+
</StackLayout>
11+
</TabView>
12+
<!-- << tabview-icon-font-html -->
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
import { Component } from "@angular/core";
2+
import { StackLayout } from "ui/layouts/stack-layout";
3+
4+
import { TabView, SelectedIndexChangedEventData, TabViewItem } from "ui/tab-view";
5+
6+
@Component({
7+
moduleId: module.id,
8+
templateUrl: "./tab-view-icon-fonts.component.html",
9+
styleUrls: ["./style.css"]
10+
})
11+
export class TabViewIconFontsComponent {
12+
13+
}

0 commit comments

Comments
 (0)