Why I can't access native UINavigationBar from ActionBar?

Issue

I was trying to access and didn’t find the UINavigationBar from an ActionBar, could someone help me there?

TS file

let bar: ActionBar = this.page.getViewById<ActionBar>("bar");
bar.ios.nativeView // undefined
bar.nativeView // undefined

HTML file

<ActionBar id="bar" class="action-bar" title="Recipients"></ActionBar>

Solution

Ok I figure out what i’ve done wrong just putting in Manoj Solution

HTML:

<ActionBar id="bar" class="action-bar" title="Recipients" (loaded)="loadActionBar($event)"></ActionBar>

TS:

loadActionBar($event): void {
   let bar: ActionBar = this.page.getViewById<ActionBar>("bar");
   bar.nativeView // works
}

Answered By – caiobiodere

Answer Checked By – Candace Johnson (AngularFixing Volunteer)

Leave a Reply

Your email address will not be published.