0

我是安卓新手。当我尝试在 中创建新的(横向)布局时layout-land folder,它说:

你想覆盖文件 res/layout/main.xml

为什么要替换另一个布局?在 Eclipse 中,我右键单击 layout-land 文件夹并选择 New -> Others -> XML layout file。但它想用我原来的布局文件替换它。怎么来的?虽然我在横向布局中使用了与 main.xml 相同的名称,但我知道这不应该冲突。

4

3 回答 3

0

您是否将文件夹放置为 res/layout-normal-land?

阅读此链接以供参考 - http://developer.android.com/guide/practices/screens_support.html

于 2012-09-03T10:31:49.970 回答
0

what eclipse writes contradicts what you claim you try to do .

it talks about "layout" folder , and you talk about "layout-land" folder.

are you sure you put the file in the correct place?

anyway , your assumption is correct : you can put the same name in multiple places , adn it's a very common solution to handle multiple configurations (using what is called "qualifiers" ) .

more info here and here .

于 2012-09-01T21:23:36.323 回答
0

要添加一个新布局,您应该给 main.xml 以外的其他名称,因为它已经存在。

于 2012-09-01T18:44:52.030 回答