Reputation: 116
Is it possible to set the background-image property of an ActionBar in NativeScript?
I know you can change the background color, but I'm not able to get a background image to show up.
I know you can do this in Native iOS and I'm sure in Android as well, how can it be done in {NS}? I've checked the NS docs but it doesn't have anything on an actual background-image, only displaying images themselves.
Upvotes: 1
Views: 906
Reputation: 1
import { Component, ChangeDetectionStrategy, OnInit } from '@angular/core';
import { Page } from 'ui/page';
@Component({
selector: 'home',
templateUrl: 'modules/home/home.component.html',
changeDetection: ChangeDetectionStrategy.OnPush
})
export class HomeComponent {
constructor(private page : Page){
}
ngOnInit() {
this.page.actionBar.backgroundImage = "res://actionbar_bg";
}
}
this one worked for me
Upvotes: 0