Skip to content

Commit 9ac9e5a

Browse files
author
Alexander Vakrilov
authored
Merge pull request #3754 from NativeScript/fix-ios-action-bar-reset
Fix: Action-bar bg-color in ios not resetting
2 parents 17650d2 + e69bc78 commit 9ac9e5a

File tree

2 files changed

+7
-9
lines changed

2 files changed

+7
-9
lines changed

apps/app/ui-tests-app/page/page-status-bar-css.xml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,19 +16,19 @@
1616
<Button text="22" tap="applyTapOnStyledActionBar" tag="status-bar-style: dark;" style.fontSize="8" width="40" height="40" automationText="dark-abb-ruby" />
1717

1818
<!-- status-bar-style - page - background -->
19-
<Button text="51" tap="applyTap" tag="status-bar-style: light;background-color: #E0115F;" style.fontSize="8" width="40" height="40" automationText="light-bckg-ruby" />
19+
<Button text="51" tap="applyTap" tag="status-bar-style: light; background-color: #E0115F;" style.fontSize="8" width="40" height="40" automationText="light-bckg-ruby" />
2020
<Button text="52" tap="applyTap" tag="status-bar-style: dark; background-color: #E0115F;" style.fontSize="8" width="40" height="40" automationText="dark-bckg-ruby" />
2121

2222
<!-- status-bar-style - page - and - action-bar - background -->
2323
<Button text="61" tap="applyTapOnStyledActionBar" tag="status-bar-style: light;background-color: #E0115F;" style.fontSize="8" width="40" height="40" automationText="light-bckg-yellow-abbckg-ruby" />
24-
<Button text="62" tap="applyTapOnStyledActionBar" tag="status-bar-style: dark; ;background-color: #E0115F;" style.fontSize="8" width="40" height="40" automationText="dark-bckg-yellow-abbckg-ruby" />
24+
<Button text="62" tap="applyTapOnStyledActionBar" tag="status-bar-style: dark;background-color: #E0115F;" style.fontSize="8" width="40" height="40" automationText="dark-bckg-yellow-abbckg-ruby" />
2525

2626
<!-- status-bar-style - action-bar - hidden - and - backgroundSpanUnderStatusBar -->
2727
<Button text="71" tap="applyTapWithSpan" tag="status-bar-style: light;background-color: yellow" style.fontSize="8" width="40" height="40" automationText="dark-bckg-yellow-bckgsusb-true" />
28-
<Button text="72" tap="applyTapOnStyledActionBarAndSpan" tag="status-bar-style: light;background-color: yellow;" style.fontSize="8" width="40" height="40" automationText="light-bckg-yellow-abbck-ruby-bckgsusb-true" />
28+
<Button text="72" tap="applyTapOnStyledActionBarAndSpan" tag="status-bar-style: light; background-color: yellow;" style.fontSize="8" width="40" height="40" automationText="light-bckg-yellow-abbck-ruby-bckgsusb-true" />
2929

3030
<Button text="73" tap="applyTapWithSpan" tag="status-bar-style: dark;background-color: yellow;" style.fontSize="8" width="40" height="40" automationText="light-ab-hidden-bckgsusb-true" />
31-
<Button text="74" tap="applyTapWithActionBarHiddenAndSpan" tag="status-bar-style: dark;background-color: yellow;" style.fontSize="8" width="40" height="40" automationText="dark-ab-hidden-bckgsusb-true" />
31+
<Button text="74" tap="applyTapWithActionBarHiddenAndSpan" tag="status-bar-style: dark; background-color: yellow;" style.fontSize="8" width="40" height="40" automationText="dark-ab-hidden-bckgsusb-true" />
3232

3333
</WrapLayout>
3434

tns-core-modules/ui/action-bar/action-bar.ios.ts

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -323,15 +323,13 @@ export class ActionBar extends ActionBarBase {
323323
}
324324

325325
get [backgroundColorProperty.native](): UIColor {
326-
let navBar = this.navBar;
327-
if (navBar) {
328-
return navBar.barTintColor;
329-
}
326+
// This getter is never called.
327+
// CssAnimationProperty use default value form their constructor.
330328
return null;
331329
}
332330
set [backgroundColorProperty.native](value: UIColor | Color) {
333331
let navBar = this.navBar;
334-
if (navBar && value) {
332+
if (navBar) {
335333
let color = value instanceof Color ? value.ios : value;
336334
navBar.barTintColor = color;
337335
}

0 commit comments

Comments
 (0)