Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- protected override void OnCreate (Bundle bundle)
- {
- base.OnCreate (bundle);
- global::Xamarin.Forms.Forms.Init (this, bundle);
- var metrics = Resources.DisplayMetrics;
- var widthInDp = ConvertPixelsToDp(metrics.WidthPixels);
- var heightInDp = ConvertPixelsToDp(metrics.HeightPixels);
- App.ScreenWidth = metrics.WidthPixels;
- App.ScreenHeight = metrics.HeightPixels;
- LoadApplication (new App ());
- }
- public int ConvertPixelsToDp(float pixelValue)
- {
- var dp = (int) ((pixelValue)/Resources.DisplayMetrics.Density);
- return dp;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement