0

我正在开发一个在 Fremantle (N900) 上运行 Harmattan (N9) 应用程序的程序。问题之一是分辨率差异。

N900 有 800x480 屏幕和 N9 854x480。因为这部分画面被切断了。

我可以愚弄(某事),让它认为 800px 屏幕包含 854px 并绘制所有元素(所有元素都被绘制成好像 854px 可用)。我知道由于调整一维的大小,形状会不自然,但它比截断布局要好。

这必须在不重新编译的情况下完成,因为我无法访问 N9 的每个应用程序的源代码。我无法编辑 qml 文件,因为它们内置于 qrc

提前致谢

马米斯特

4

1 回答 1

0

If you code for different sizes of screens, you had better not use the raw values of screen dimensions. What you can do is saying that "this item with fill pw% of the width and ph% of the height". It will be automatically resized with the property binding. In your QML code, you can write something like this :

MyItem {
    id: my_item
    width: (pw / 100) * screen_width
    height: (ph / 100) * screen_height
    // ...
}
于 2012-08-10T02:44:52.490 回答