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;//横屏,禁止竖屏

posted @ 2019-01-01 22:53  没事儿写个bug  阅读(659)  评论(0编辑  收藏  举报