Xamarin.Android 开发中遇到旋转屏幕错误

错误信息 : System.NotSupportedException: Unable to find the default constructor on type App5.MyFragment.  Please provide the missing constructor.

错误图片:

解决方法:干脆不让他旋转屏幕,当下QQ、微信等app都没有旋转等功能,且旋转后重新绘制界面影响用户使用。

 this.RequestedOrientation = Android.Content.PM.ScreenOrientation.Portrait;//竖屏,禁止横屏

 this.RequestedOrientation = Android.Content.PM.ScreenOrientation.Nosensor;//横屏,禁止竖屏

猜你喜欢

转载自www.cnblogs.com/swjian/p/10206466.html