Quantcast
Channel: Xamarin.Forms — Xamarin Community Forums
Viewing all articles
Browse latest Browse all 75885

Xamarin.Forms.Device.Idiom issue on tablet

$
0
0

Hi,
I have to open my application in portrait mode in phones and landscape mode in tablets. I am using below code for changing screen orientation. Its working fine in android phone. But in samsung galaxy tab 2 (API Level 16) sometimes i am getting Xamarin.Forms.Device.Idiom =Phone instead of tablet.

if (Xamarin.Forms.Device.Idiom == Xamarin.Forms.TargetIdiom.Tablet) {
            RequestedOrientation = global::Android.Content.PM.ScreenOrientation.Landscape | global::Android.Content.PM.ScreenOrientation.ReverseLandscape;
        } else {
            RequestedOrientation = global::Android.Content.PM.ScreenOrientation.Portrait;
        }

Viewing all articles
Browse latest Browse all 75885

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>