1

Android has a nice way to make screen elements scaleable so they look good on most devices. One of those is Device Independent Pixels: basics of device-independent-pixels

Is there anything similar to dips on Windows Phone 7?

What about autosizing a control to its contents? Such as width=wrap_content?

Thanks!

Community
  • 1
  • 1
swinefeaster
  • 2,525
  • 3
  • 30
  • 48

2 Answers2

6

WP7 devices always have the same resolution so you shouldn't need to worry about DPI.

While devices can have different physical sizes they shouldn't differ too much. If you are really concerned you shoudl simply design and test on devices with the smallest and largest physical sizes.
If you still run into issue then it's probably due to trying to put too much on the screen. If that's the case then you should redesign the app.

One of the original design objectives for WP7 was to create a platform which did not suffer the consequences of device fragmentation such as wildly differing screen sizes and resolutions. As such there is no need to have to code for them.


NB This is the case for WP7, however WP8 supports 3 resolutions. For details on how to support WP8 see http://msdn.microsoft.com/en-us/library/windowsphone/develop/jj206974(v=vs.105).aspx

Matt Lacey
  • 65,560
  • 11
  • 91
  • 143
  • For example, the design view has different screen size in pixels compared to the emulator. Should I just assume that the xaml will get scaled accordingly? – swinefeaster May 23 '11 at 07:56
  • both the designers in VS & Blend and the emulator can be zoomed. Their size on screen is also dependent upon the DPI of the monitor that is being used. None of these options impact the resolution on an actual device and there is no guaranteed way of determining the DPI on a physical device. Don't worry about screen size and scaling on the development PC. – Matt Lacey May 23 '11 at 08:17
  • Unfortunately, this isn't the case anymore. – Arjun Abhynav Nov 29 '12 at 16:26
  • @ArjunAbhynav the question was asked and answered in May 2011 when that was the case and clearly refers to WP7. I have added a note about WP8. – Matt Lacey Nov 29 '12 at 17:47
  • Oh well yes, I knew that the answer was in to the context then. And I was having a problem with the current multiple resolution scenario, and was searching for a solution when I landed here. So thought I'd leave a comment. And thanks for the new link. +1 – Arjun Abhynav Dec 02 '12 at 12:08
0

Not sure if that answers your question, but the Grid control is usually the best approach when you want to create a layout that adapts to different sizes.

I don't know of an equivalent to Android's device-independent pixels, though.

Andréas Saudemont
  • 1,353
  • 10
  • 8