简体   繁体   English

Ionic 3 setRoot在iOS设备上不起作用

[英]Ionic 3 setRoot NOT working on IOS device

i am testing a the hello world app on an iPhone4 device and some others devices with Android. 我正在iPhone4和其他装有Android的设备上测试hello world应用。

Ionic version 3.10.3 离子版本3.10.3

npm version 3.10.10 npm版本3.10.10

.

The main huge problem is with the iPhone device, the call to setRoot is not working. 主要巨大的问题是与iPhone设备,调用setRoot不工作。 ("WORKS on Emulators") (“仿真器上的工作”)

void onGoClick(){
// this line **DOES NOTHING** and no error is thrown.

this.navCtrl.setRoot(HomePage);


// this line **DOES NOTHING** and no error is thrown.

this.app.getRootNav().setRoot(HomePage);

// this line **DOES NOTHING** and no error is thrown.

this.app.getRootNav().setRoot("HomePage");
}

this also DOES NOT WORK 这也不起作用

var root = this.appCtrl.getRootNav();
root.popToRoot();
root.setRoot( "HomePage" );

or without quotes root.setRoot( HomePage ); 或不带引号root.setRoot( HomePage );

.

but if i click the button twice it works.... 但是,如果我单击按钮两次,它将起作用。

is like some refresh is missing.... 好像缺少一些刷新...。

Regards. 问候。

The problem is with the iOS version, 4 is too old, if you test with an iPhone 6. 问题在于iOS版本,如果您使用iPhone 6进行测试,则版本4太旧了。

you can also try to run like this. 您也可以尝试这样运行。

 this.navCtrl.setRoot(DestinationPage).then( ()=>{ this.navCtrl.popToRoot().then( ()=> { }).catch(err=>{ TError.handleException( "err 2: ", err ); }); }).catch(err=>{ }); 

Regards. 问候。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM