Eclipse 和 Android XML 布局提供“默认”布局不是任何设备/区域设置组合的最佳匹配”
这是我第一次使用 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
不,不要忽视它,它确实意味着什么。
它的意思是 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.
不要在选择 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
我遇到了这个问题,对我来说,只需从布局的图形视图中的下拉菜单“关联活动或提供上下文的片段”中选择我的项目“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.