在我的活動中,我有以下代碼。Android - 即使在自動旋轉開啓時將應用程序屏幕方向設置爲風景,設備屏幕也會翻轉
[Activity(Label = "SampleActivity", ConfigurationChanges = Android.Content.PM.ConfigChanges.Orientation | Android.Content.PM.ConfigChanges.ScreenSize | Android.Content.PM.ConfigChanges.KeyboardHidden)]
在OnCreate中() - >
if (Build.VERSION.SdkInt >= Build.VERSION_CODES.Gingerbread) {
RequestedOrientation = ScreenOrientation.SensorLandscape;
}
else {
RequestedOrientation = ScreenOrientation.Landscape;
}
還在屏幕在橫向模式本身翻轉如果自動旋轉爲ON試用版清單想知道爲什麼發生這種情況。是嗎?任何避免翻轉的選項?
需要幫助。提前感謝。
上面的代碼是什麼我已經添加在Xamarin中。所以,我已經加入了Activity。謝謝。 – sha
我歡迎@sha,你可以接受我的答案,如果你喜歡:) – Awadesh