| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -11,7 +11,7 @@ | |||
| 11 | 11 | </StackLayout> | |
| 12 | 12 | <GridLayout row="1"> | |
| 13 | 13 | <BottomNavigation automationText="tabNavigation" loaded="bottomNavigaitonLoaded" items="{{ tabContentItems }}"> | |
| 14 | - <TabStrip items="{{ tabStripItems }}"> | ||
| 14 | + <TabStrip items="{{ tabStripItems }}" iosIconRenderingMode="alwaysOriginal"> | ||
| 15 | 15 | </TabStrip> | |
| 16 | 16 | </BottomNavigation> | |
| 17 | 17 | </GridLayout> | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -3,23 +3,8 @@ | |||
| 3 | 3 | <ActionBar title="BottomNavigation" icon="" class="action-bar"> | |
| 4 | 4 | </ActionBar> | |
| 5 | 5 | ||
| 6 | - <!-- w/o TabStrip --> | ||
| 7 | - <!-- <BottomNavigation> | ||
| 8 | - <TabContentItem> | ||
| 9 | - <GridLayout> | ||
| 10 | - <Label text="First View"/> | ||
| 11 | - </GridLayout> | ||
| 12 | - </TabContentItem> | ||
| 13 | - <TabContentItem> | ||
| 14 | - <GridLayout> | ||
| 15 | - <Label text="Second View"/> | ||
| 16 | - </GridLayout> | ||
| 17 | - </TabContentItem> | ||
| 18 | - </BottomNavigation> --> | ||
| 19 | - | ||
| 20 | - <!-- w/ TabStrip --> | ||
| 21 | 6 | <BottomNavigation id="bottomNav" automationText="tabNavigation" > | |
| 22 | - <TabStrip> | ||
| 7 | + <TabStrip iosIconRenderingMode="alwaysOriginal"> | ||
| 23 | 8 | <TabStripItem title="First Tab 11" iconSource="res://icon"></TabStripItem> | |
| 24 | 9 | <TabStripItem> | |
| 25 | 10 | <!-- <Image src="res://icon" /> --> | |
@@ -71,26 +56,4 @@ | |||
| 71 | 56 | </StackLayout> | |
| 72 | 57 | </TabContentItem> | |
| 73 | 58 | </BottomNavigation> | |
| 74 | - | ||
| 75 | - <!-- =============================================================================================== --> | ||
| 76 | - | ||
| 77 | - <!-- Bottom Bar with TabStrip --> | ||
| 78 | - <!-- <BottomNavigationBar> | ||
| 79 | - <TabStrip> | ||
| 80 | - <TabStripItem title="First Tab" iconSource="res://icon"></TabStripItem> | ||
| 81 | - <TabStripItem> | ||
| 82 | - <Image src="res://icon" /> | ||
| 83 | - <Label text="Second Tab" /> | ||
| 84 | - </TabStripItem> | ||
| 85 | - </TabStrip> | ||
| 86 | - </BottomNavigationBar> --> | ||
| 87 | - | ||
| 88 | - <!-- Bottom Bar w/o TabStrip --> | ||
| 89 | - <!-- <BottomNavigationBar> | ||
| 90 | - <TabStripItem title="First Tab" iconSource="res://icon"></TabStripItem> | ||
| 91 | - <TabStripItem> | ||
| 92 | - <Image src="res://icon" /> | ||
| 93 | - <Label text="Second Tab" /> | ||
| 94 | - </TabStripItem> | ||
| 95 | - </BottomNavigationBar> --> | ||
| 96 | 59 | </Page> | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -2,7 +2,7 @@ | |||
| 2 | 2 | <ActionBar title="BottomNavigation" icon="" class="action-bar"> | |
| 3 | 3 | </ActionBar> | |
| 4 | 4 | <BottomNavigation id="bottomNavigation" automationText="tabNavigation" class="font-awesome"> | |
| 5 | - <TabStrip> | ||
| 5 | + <TabStrip iosIconRenderingMode="alwaysOriginal"> | ||
| 6 | 6 | <TabStripItem title="motorcycle-res" iconSource="res://baseline_motorcycle_black_24"></TabStripItem> | |
| 7 | 7 | <TabStripItem iconSource="font://" title="icon"> | |
| 8 | 8 | </TabStripItem> | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -3,7 +3,7 @@ | |||
| 3 | 3 | </ActionBar> | |
| 4 | 4 | ||
| 5 | 5 | <BottomNavigation id="tab-view" selectedIndexChanged="onSelectedIndexChanged" automationText="tabNavigation" > | |
| 6 | - <TabStrip> | ||
| 6 | + <TabStrip iosIconRenderingMode="alwaysOriginal"> | ||
| 7 | 7 | <TabStripItem iconSource="res://icon" title="selected"></TabStripItem> | |
| 8 | 8 | <TabStripItem iconSource="res://testlogo" title="unselected"></TabStripItem> | |
| 9 | 9 | </TabStrip> | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -531,7 +531,15 @@ export class BottomNavigation extends TabNavigationBase { | |||
| 531 | 531 | } | |
| 532 | 532 | ||
| 533 | 533 | private getIconRenderingMode(): UIImageRenderingMode { | |
| 534 | - return UIImageRenderingMode.AlwaysOriginal; | ||
| 534 | + switch (this.tabStrip && this.tabStrip.iosIconRenderingMode) { | ||
| 535 | + case "alwaysOriginal": | ||
| 536 | + return UIImageRenderingMode.AlwaysOriginal; | ||
| 537 | + case "alwaysTemplate": | ||
| 538 | + return UIImageRenderingMode.AlwaysTemplate; | ||
| 539 | + case "automatic": | ||
| 540 | + default: | ||
| 541 | + return UIImageRenderingMode.Automatic; | ||
| 542 | + } | ||
| 535 | 543 | } | |
| 536 | 544 | ||
| 537 | 545 | private getIcon(tabStripItem: TabStripItem): UIImage { | |
@@ -547,10 +555,12 @@ export class BottomNavigation extends TabNavigationBase { | |||
| 547 | 555 | const color = target.style.color; | |
| 548 | 556 | const iconTag = [iconSource, font.fontStyle, font.fontWeight, font.fontSize, font.fontFamily, color].join(";"); | |
| 549 | 557 | ||
| 558 | + let isFontIcon = false; | ||
| 550 | 559 | let image: UIImage = this._iconsCache[iconTag]; | |
| 551 | 560 | if (!image) { | |
| 552 | 561 | let is = new ImageSource; | |
| 553 | 562 | if (isFontIconURI(iconSource)) { | |
| 563 | + isFontIcon = true; | ||
| 554 | 564 | const fontIconCode = iconSource.split("//")[1]; | |
| 555 | 565 | is = fromFontIconCode(fontIconCode, font, color); | |
| 556 | 566 | } else { | |
@@ -564,7 +574,11 @@ export class BottomNavigation extends TabNavigationBase { | |||
| 564 | 574 | image = this.getFixedSizeIcon(image); | |
| 565 | 575 | } | |
| 566 | 576 | ||
| 567 | - const originalRenderedImage = image.imageWithRenderingMode(this.getIconRenderingMode()); | ||
| 577 | + let renderingMode: UIImageRenderingMode = UIImageRenderingMode.AlwaysOriginal; | ||
| 578 | + if (!isFontIcon) { | ||
| 579 | + renderingMode = this.getIconRenderingMode(); | ||
| 580 | + } | ||
| 581 | + const originalRenderedImage = image.imageWithRenderingMode(renderingMode); | ||
| 568 | 582 | this._iconsCache[iconTag] = originalRenderedImage; | |
| 569 | 583 | image = originalRenderedImage; | |
| 570 | 584 | } else { | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -885,6 +885,7 @@ export class Tabs extends TabsBase { | |||
| 885 | 885 | } | |
| 886 | 886 | ||
| 887 | 887 | private getIconRenderingMode(): UIImageRenderingMode { | |
| 888 | + // MDCTabBar doesn't work with rendering mode AlwaysTemplate | ||
| 888 | 889 | return UIImageRenderingMode.AlwaysOriginal; | |
| 889 | 890 | } | |
| 890 | 891 | ||
| Back | FazBrowse Home | New Git URL |
0 commit comments