Eclipse 和 Android XML 布局提供“默认”布局不是任何设备/区域设置组合的最佳匹配”

发布于 2024-09-24 09:53:41 字数 471 浏览 4 评论 0原文

这是我第一次使用 XML 布局制作应用程序。过去我总是在运行时动态生成布局,所以不用担心,我不是 Android 新手。不过,这是我第一次使用静态布局。那么这条消息到底是关于什么的呢?

[2010-09-22 20:43:23 - Rockport]“默认”不是任何设备/区域设置组合的最佳匹配。
[2010-09-22 20:43:23 - Rockport] 以“区域设置语言 ___Region __”显示,正常屏幕,短屏幕宽高比,横向,无坞站,白天,中等密度,基于手指的触摸屏,软键盘、Qwerty 键盘、轨迹球导航、屏幕分辨率 480x320'

每次我打开 layout/ 文件夹中的布局之一时,它都会打印到我的 Eclipse 控制台。如果我从任何其他文件夹(例如 layout-land/)打开布局,则不会收到任何消息。难道只是图形布局编辑器说:“我将如何为您显示内容?”我可以安全地忽略它吗?

This is my first time making an app with XML layouts. In the past I have always dynamically generated my layouts at runtime, so don't worry, I am NOT an Android newbie. Still, this is my first time with static layouts. So what's this message all about?

[2010-09-22 20:43:23 - Rockport] 'default' is not a best match for any device/locale combination.
[2010-09-22 20:43:23 - Rockport] Displaying it with 'Locale Language ___Region __, Normal Screen, Short screen aspect ratio, Landscape Orientation, No Dock, Day time, Medium Density, Finger-based touchscreen, Soft keyboard, Qwerty keybard, Trackball navigation, Screen resolution 480x320'

It gets printed to my Eclipse console every time I open up one of the layouts in the layout/ folder. If I open the layout from any other folder, such as layout-land/ then I get no message. Is it just the graphical layout editor saying, "Here's how I'm going to display things for you?" Can I safely ignore it?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

白馒头 2024-10-01 09:53:41

不,不要忽视它,它确实意味着什么。

它的意思是 Eclipse 已经找到了它认为更准确的布局,并且正在切换到它。

例如,如果您有默认布局和低密度布局,它将切换到低密度布局。您对布局所做的任何更改都将在低密度代码中进行,而不是在默认代码中进行。

我不知道如何切换回来,除了关闭 xml 并打开正确的 xml 之外,这变得非常烦人。

如果有人知道如何切换,并且我已经尝试在低密度和中密度设备之间更改编辑器顶部的设置,请告诉我。谢谢。

No don't ignore it, it does mean something.

What it is saying is that Eclipse has found a layout which it believes is more accurate and is switching to it.

So for example if you have a default layout and a low density layout, it will switch to the low density layout. Any changes you make to the layout will be in the low density code not in the default code.

I don't know how to switch back, which is getting very annoying, apart from closing the xml and opening up the correct one.

If anyone knows how to switch, and yes I have tried changing the settings at the top of the editor between low density and medium density devices, please tell me. Thanks.

烟柳画桥 2024-10-01 09:53:41

不要在选择 XML 文件的情况下运行项目。 clean build项目,只点击项目名称,选择run后就不会出现这个错误

Do not run the project with the file XML selected. Clean build the project, Only click in the project name, after select run, you won't have this error

∞琼窗梦回ˉ 2024-10-01 09:53:41

我遇到了这个问题,对我来说,只需从布局的图形视图中的下拉菜单“关联活动或提供上下文的片段”中选择我的项目“MainActivity”即可解决。

I had this problem and for me just solved by selecting my projects "MainActivity" from dropdown menu "Associated activity or fragment providing context" in the graphical view of my layout.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文