FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

feat(ActionBar): apply text color when largeTitletextAttribute is set… · NativeScript/NativeScript@b58dff0 · GitHub

Commit b58dff0

Browse files
authored andcommitted
feat(ActionBar): apply text color when largeTitletextAttribute is set on iOS (#6631)
* apply CSS text color when largeTitletextAttribute is set on iOS * common logic improvment
1 parent 65e3a19 commit b58dff0

1 file changed

Lines changed: 10 additions & 10 deletions

File tree

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

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -258,16 +258,22 @@ export class ActionBar extends ActionBarBase {
258258

259259
private updateColors(navBar: UINavigationBar) {
260260
const color = this.color;
261+
this.setColor(navBar, color);
262+
263+
const bgColor = <Color>this.backgroundColor;
264+
navBar.barTintColor = bgColor ? bgColor.ios : null;
265+
}
266+
267+
private setColor(navBar: UINavigationBar, color?: Color) {
261268
if (color) {
262269
navBar.titleTextAttributes = <any>{ [NSForegroundColorAttributeName]: color.ios };
270+
navBar.largeTitleTextAttributes = <any>{ [NSForegroundColorAttributeName]: color.ios };
263271
navBar.tintColor = color.ios;
264272
} else {
265273
navBar.titleTextAttributes = null;
274+
navBar.largeTitleTextAttributes = null;
266275
navBar.tintColor = null;
267276
}
268-
269-
const bgColor = <Color>this.backgroundColor;
270-
navBar.barTintColor = bgColor ? bgColor.ios : null;
271277
}
272278

273279
public _onTitlePropertyChanged() {
@@ -359,13 +365,7 @@ export class ActionBar extends ActionBarBase {
359365
}
360366
[colorProperty.setNative](color: Color) {
361367
const navBar = this.navBar;
362-
if (color) {
363-
navBar.tintColor = color.ios;
364-
navBar.titleTextAttributes = <any>{ [NSForegroundColorAttributeName]: color.ios };
365-
} else {
366-
navBar.tintColor = null;
367-
navBar.titleTextAttributes = null;
368-
}
368+
this.setColor(navBar, color);
369369
}
370370

371371
[backgroundColorProperty.getDefault](): UIColor {

0 commit comments

Comments
 (0)

Back | FazBrowse Home | New Git URL