简体   繁体   English

在Xamarin.ios中调用异步方法后,UIDeviceOrientation通知未得到调用

[英]UIDeviceOrientation notification not getting call after calling async method in Xamarin.ios

I am calling async method in ViewDidLoad() method. 我在ViewDidLoad()方法中调用异步方法。 It will take time so I have added Loading overlay. 这需要时间,因此我添加了“加载”叠加层。 but whenever I try to rotate my device I am not able to rotate until I get the response from the async method. 但是每当我尝试旋转设备时,直到从async方法获得响应后,我才能旋转。

Are you awaiting the method? 您在等待方法吗? If thats the case then its normal as ViewDidLoad will not finish until the awaited code gets executed. 如果真是这样,那么直到完成等待的代码,它的正常ViewDidLoad才会完成。

Dont await the method and it should rotate normally. 不要等待该方法,它应该可以正常旋转。

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

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