How to get screen resolutions on Windows Phone devices

前端 未结 3 1602
灰色年华
灰色年华 2021-01-22 03:53

I am running into issue and would appreciate expert’s help here. I am trying to get screen resolution so that I can use appropriate layouts/images based on phone types.

3条回答
  •  被撕碎了的回忆
    2021-01-22 04:35

    As stated in the MSDN article you linked to: MSDN

    Windows Phone 7 only supported a single resolution, 800 x 480. Since your project is targeting WP7, that would be the expected behavior. If you are developing a Windows Phone 8 project, then you should see that App.Current.Host.Content.ScaleFactor should return different results.

    You will probably need to create a WP8 project to customize for the various resolutions in WP8. If you still want to support WP7 devices, then you will need to create a separate WP7 project.

提交回复
热议问题