Почему я не могу получить доступ к встроенному UINavigationBar из ActionBar?

Я пытался получить доступ и не нашел UINavigationBar из ActionBar, может ли кто-нибудь мне помочь?

TS файл

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

HTML файл

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

person caiobiodere    schedule 12.10.2018    source источник
comment
Когда именно вы пытаетесь получить доступ к nativeView? Он должен быть доступен в загруженном событии.   -  person Manoj    schedule 13.10.2018
comment
@Manoj Пробую эти события - ngAfterViewInit, ngOnInit.   -  person caiobiodere    schedule 13.10.2018


Ответы (1)


Хорошо, я понимаю, что я сделал не так, просто вставив 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
}
person caiobiodere    schedule 13.10.2018