Eclipse and Android XML layouts gives “'default' is not a best match for any device/locale combination”

后端 未结 3 604
耶瑟儿~
耶瑟儿~ 2020-12-03 08:27

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. S

相关标签:
3条回答
  • 2020-12-03 08:38

    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.

    0 讨论(0)
  • 2020-12-03 08:56

    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

    0 讨论(0)
  • 2020-12-03 09:03

    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.

    0 讨论(0)
提交回复
热议问题