Create a compatible UI program on Windows Mobile

Source: Internet
Author: User

Reply | reference | edit | top

Look at the aboveEmulator Yes.WM 2003se ,5.0 ,6.0 YesPocket PC ,Smartphone ,Classic ,Professional Of, including English, Chinese, resolution,DPI Each has its own differences. In so many dazzlingWm Develop applications on the platformProgram,UI Design, especiallyCompatible OfUI Policy is very important. Previous Docking and anchoring controls on Windows Mobile Also. InMsdn We can see that this aspect is more instructive.ArticleCreate compatible user interfaces And I think it is necessary to discuss with you.

1.GeneralUIPolicy

L do not set the screen information to dead when writing Code , instead, use getsystemmetrics or getclientrect to obtain the current size of the screen. Similarly, in managed code, use form width , height attribute.

L Process resize events. When the device loads programs, dynamically loads the interface, or changes the screen direction, we need to test form width and height.

L use a separate control. If possible, use a separate control to overwrite the entire screen. For example, listview or Treeview .

L control layout. The screen is changed from portrait mode to landscape mode, or from landscape when the mode changes to portrait mode, we need to consider changing the layout of the control. Of course, the simplest way is to use the anchor and dock attribute. 1 This shows the subtle difference:

Figure1: Control usageAnchor and dockAttribute differences

If we doNative codeDevelopment, you can referMsdnOnIntroducing screenlib.

L When testing, try to use moreEmulatorAndPortraitMode andLandscapeSwitching between modes to test the performance of the applications we write.

2.Font and font size

UseShgetuimetricsFunction to detect the font size selected by the user, and use the same font in the application, so that the user can have a consistent experience. Applications can listenSh_uimetric_changeMessage to obtain the event for the user to change the default settings.

3.User Interface color

AllFormControl will adapt to the current topic(Theme)Of course, if we useGDITo re-paint, it is best to get the topic information used by the current system, and then use a consistent policy for the control.

4. Soft keyPolicy

GenerallySoft keyIs to execute a common command, rather than a menu. Right sideSoft keyGenerally, the menu is displayed, and the most common options are placed in the first line for highlighting. At the same time, avoid using more than two levels of sub-menus.

5.Program icon

different from Pc applications, Windows Mobile Use icons of different sizes . In general, we include program icons at different resolutions in the resource, and detect them when the program is running, and then decide the add-on. For more information, see Windows Mobile blog: Which icon sizes shoshould I use in my application? . fox23 blog This is also described.

6.Avoid bitmap

BecauseWindows MobileThe screen size, resolution, and shape of the device are different, which may lead to different image display effects. The same bitmap96 DPI, 320x240And192 DPI, 480x480", The display effect is as follows:2As shown in:

Figure2: Effects of the same bitmap on screens with different resolutions

As you can see, in high resolution, the same bitmap is not suitable for the screen.

 

References: Create compatible user interfaces/Introducing screenlib/Which icon sizes shoshould I use in my application?.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.